Hi Bruno,

Bruno Haible <br...@clisp.org> writes:

> modules/ieee754-h is simpler, with a use of _GL_GNULIB_HEADER that is
> effectively replaced with 1 on the gnulib side. But this works only if
> there are no other substitutions to be made (no @...@ replacements)
> in preprocessor lines. (I would not bet that code like this:
>   #if 0
>   # if @FOOBAR@
>   # endif
>   #endif
> works for all C and C++ compilers. Better avoid that.)

I always wondered if a compiler would fail with that. As far as I
remember gcc and clang handle it fine. But I agree it is best to avoid
to be safe (and since it would be ugly in an installed header).

> In any case, the ieee754-h approach is not to think "let's look at the
> gnulib .in.h file and see how we can adapt it for glibc" but instead
> "let's create a well-formed .h file for glibc and then let's see how we
> can massage it so that it works with gnulib".
>
> The latter approach leads me to the following patch (that should work
> when the header is installed in /usr/include and even with "gcc -Wundef"):

Makes sense. Thanks!

Collin

Reply via email to