%% Eli Zaretskii <[EMAIL PROTECTED]> writes:

  >> Date: Sat, 09 Jul 2005 10:08:59 +0100
  >> From: "J. Grant" <[EMAIL PROTECTED]>
  >> CC: "Paul D. Smith" <[EMAIL PROTECTED]>,  [email protected]

  >> > Wrt the last one: isn't the convention to #undef a symbol rather than
  >> > define it to zero?

  >> Agreed, often the convention is.  I am not sure why this one is
  >> different in the ./configure generated config.h on MSYS/MinGW +
  >> GNU/Linux.

  ez> Paul, any thoughts on why configure does that in this case?

I had a bug reported against this in UNIX, too, so I looked it up in the
docs (gasp!! :-)) and sure enough:

   - Macro: AC_CHECK_DECLS (SYMBOLS, [ACTION-IF-FOUND],
            [ACTION-IF-NOT-FOUND], [INCLUDES = `default-includes'])
       For each of the SYMBOLS (_comma_-separated list), define
       `HAVE_DECL_SYMBOL' (in all capitals) to `1' if SYMBOL is declared,
       otherwise to `0'.  If ACTION-IF-NOT-FOUND is given, it is
       additional shell code to execute when one of the function
       declarations is needed, otherwise ACTION-IF-FOUND is executed.

       This macro uses an m4 list as first argument:
            AC_CHECK_DECLS(strdup)
            AC_CHECK_DECLS([strlen])
            AC_CHECK_DECLS([malloc, realloc, calloc, free])

       Unlike the other `AC_CHECK_*S' macros, when a SYMBOL is not
       declared, `HAVE_DECL_SYMBOL' is defined to `0' instead of leaving
       `HAVE_DECL_SYMBOL' undeclared.  When you are _sure_ that the check
       was performed, use `HAVE_DECL_SYMBOL' just like any other result
       of Autoconf:

            #if !HAVE_DECL_SYMBOL
            extern char *symbol;
            #endif

       If the test may have not been performed, however, because it is
       safer _not_ to declare a symbol than to use a declaration that
       conflicts with the system's one, you should use:

            #if defined HAVE_DECL_MALLOC && !HAVE_DECL_MALLOC
            void *malloc (size_t *s);
            #endif

       You fall into the second category only in extreme situations:
       either your files may be used without being configured, or they
       are used during the configuration.  In most cases the traditional
       approach is enough.

It looks like they're making a distinction between "wasn't tested", "was
tested and is not available", and "is available".  Some code might care
about that distinction.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Make-w32 mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/make-w32

Reply via email to