On 09/19/11 14:15, Bruno Haible wrote:
> I hope you can choose among these three solutions.
How about a 4th solution? It's modeled on your b.2)
c) You store no additional file in Emacs' VCS. Just one addition to
configure.ac or aclocal.m4:
AH_VERBATIM([
#define TRY_MSVC_INVAL if (1)
#define CATCH_MSVC_INVAL else
#define DONE_MSVC_INVAL
])
And these three macros are put into config.h by gnulib as well. That
way, Emacs doesn't need to have a dummy msvc-inval.h file. And
invoking code will be simpler, since it won't need to #include
<msvc-inval.h>. And we won't need an msvc-inval.h file in Gnulib.
Putting these macros into config.h would be appropriate, since they
affect the language, much as (say) the _Noreturn macro does. We don't
have or need a "noreturn.h" include file, and likewise we shouldn't
need an "msvc-inval.h" file either.
Come to think of it, perhaps the above AH_VERBATIM bit should be in a
new Gnulib macro gl_AVOID_MSVC or something like that. This macro
could be used in packages that don't want to bother to support MSVC.
I'm still dubious about TRY_MSVC_INVAL etc., though, for reasons I
discussed earlier. At least, I'd rather see those macros used only in
contexts that are clearly Windows-specific, and would rather not see
them in ordinary mainstream code.
> * If you ask for "--avoid=msvc-inval" to work without any replacement code,
> you ask to change the contract of the module,
Yes, absolutely. And there should be no problem with that. The
msvc-inval module was just introduced a day ago. Now's the best time
to fix its API, if it has problems.