[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re-order config.h.W32 to match the order of auto* generated config.h
From: |
Paul D. Smith |
Subject: |
Re: Re-order config.h.W32 to match the order of auto* generated config.h |
Date: |
Sat, 9 Jul 2005 09:53:27 -0400 |
%% Eli Zaretskii <address@hidden> writes:
>> Date: Sat, 09 Jul 2005 10:08:59 +0100
>> From: "J. Grant" <address@hidden>
>> CC: "Paul D. Smith" <address@hidden>, address@hidden
>> > 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 <address@hidden> 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
- Re-order config.h.W32 to match the order of auto* generated config.h, J. Grant, 2005/07/05
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, Paul D. Smith, 2005/07/05
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, Eli Zaretskii, 2005/07/05
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, J. Grant, 2005/07/08
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, Paul D. Smith, 2005/07/08
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, Eli Zaretskii, 2005/07/09
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, J. Grant, 2005/07/09
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, Eli Zaretskii, 2005/07/09
- Re: Re-order config.h.W32 to match the order of auto* generated config.h,
Paul D. Smith <=
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, Eli Zaretskii, 2005/07/09
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, Eli Zaretskii, 2005/07/09
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, J. Grant, 2005/07/09
- Re: Re-order config.h.W32 to match the order of auto* generated config.h, J. Grant, 2005/07/09