> Date: Sun, 22 Dec 2002 22:21:20 -0600
> From: Albert Chin <[EMAIL PROTECTED]>
> 
> Under, HP-UX 10.20, #include <limits.h> brings in <sys/time.h> which
> defines a prototype for gettimeofday().

How bizarre.  What other functions (besides gettimeofday) does
<limits.h> define?

Is there any symbol that we can define before including <limits.h>,
so that <limits.h> does not declare these undesirable prototypes?
For example, suppose we "#define _POSIX_C_SOURCE 200112L" first.
Does that make the problem go away?

Does the following patch fix things?

--- c.m4        2002-12-02 22:59:53.000000000 -0800
+++ /tmp/c.m4   2002-12-23 00:03:17.535948269 -0800
@@ -176,15 +176,23 @@
 #
 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"


Reply via email to