(AC_LANG_FUNC_LINK_TRY(C)): Deine $1 to an

innocuous variant befor including <limits.h> or <assert.h>.
This works around a bug reported by Albert Chin: HP-UX 11i
(and earlier versions) have a <limits.h> that declares
gettimeofday and many other functions.
This commit is contained in:
Paul Eggert 2002-12-24 00:16:41 +00:00
parent 41cc02ab2b
commit 50a791a2fa

View File

@ -176,15 +176,23 @@ char $2 ();])], [$2 ();])])
# #
m4_define([AC_LANG_FUNC_LINK_TRY(C)], m4_define([AC_LANG_FUNC_LINK_TRY(C)],
[AC_LANG_PROGRAM( [AC_LANG_PROGRAM(
[/* System header to define __stub macros and hopefully few prototypes, [/* Define $1 to an innocuous variant, in case <limits.h> declares $1.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define $1 innocuous_$1
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $1 (); below. which can conflict with char $1 (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */ <limits.h> exists even on freestanding compilers. */
#ifdef __STDC__ #ifdef __STDC__
# include <limits.h> # include <limits.h>
#else #else
# include <assert.h> # include <assert.h>
#endif #endif
#undef $1
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"