]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
(AC_LANG_FUNC_LINK_TRY(C)): Deine $1 to an
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 24 Dec 2002 00:16:41 +0000 (00:16 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 24 Dec 2002 00:16:41 +0000 (00:16 +0000)
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.

lib/autoconf/c.m4

index 86161a9b1cf796d613920b7fa5239fc371e3e0c1..6ae7341d28ddf8ca7938b030aac1f003ff44acd8 100644 (file)
@@ -176,15 +176,23 @@ char $2 ();])], [$2 ();])])
 #
 m4_define([AC_LANG_FUNC_LINK_TRY(C)],
 [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.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $1
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"