From: Paul Eggert Date: Tue, 24 Dec 2002 00:16:41 +0000 (+0000) Subject: (AC_LANG_FUNC_LINK_TRY(C)): Deine $1 to an X-Git-Tag: AUTOCONF-2.57a~107 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50a791a2fafc657802b70337aa7e8aefe1344a2c;p=thirdparty%2Fautoconf.git (AC_LANG_FUNC_LINK_TRY(C)): Deine $1 to an innocuous variant befor including or . This works around a bug reported by Albert Chin: HP-UX 11i (and earlier versions) have a that declares gettimeofday and many other functions. --- diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 86161a9b1..6ae7341d2 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -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 declares $1. + For example, HP-UX 11i declares gettimeofday. */ +#define $1 innocuous_$1 + +/* System header to define __stub macros and hopefully few prototypes, which can conflict with char $1 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif + +#undef $1 + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C"