#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#ifdef STDC_HEADERS
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
#endif
+#include <stddef.h>
#ifdef HAVE_STRING_H
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
# include <memory.h>
@example
@group
-#ifdef STDC_HEADERS
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
#endif
+#include <stddef.h>
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#elif !defined alloca
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([net/if.h], [], [],
[#include <stdio.h>
-#ifdef STDC_HEADERS
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
#endif
+#include <stddef.h>
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([netinet/if_ether.h], [], [],
[#include <stdio.h>
-#ifdef STDC_HEADERS
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
#endif
+#include <stddef.h>
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#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
+ which can conflict with char $1 (); below. */
+#include <limits.h>
#undef $1
/* Override any GCC internal prototype to avoid an error.
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- _AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@ifdef __STDC__
-@%:@ include <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
+ _AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include <limits.h>
Syntax error]])],
[],
[# Broken: fails on valid input.
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#ifdef STDC_HEADERS
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
#endif
+#include <stddef.h>
#ifdef HAVE_STRING_H
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
# include <memory.h>
_AC_CACHE_CHECK_INT([alignment of $1], [AS_TR_SH([ac_cv_alignof_$3])],
[(long int) offsetof (ac__type_alignof_, y)],
[AC_INCLUDES_DEFAULT([$2])
-#ifndef offsetof
-# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
-#endif
typedef struct { char x; $1 y; } ac__type_alignof_;],
[if test "$AS_TR_SH([ac_cv_type_$3])" = yes; then
AC_MSG_FAILURE([cannot compute alignment of $1], 77)
# - NAME-TO-CHECK == BODY-TO-EXPAND
# Which you can use for regular macros with or without arguments, e.g.,
# m4_require([AC_PROG_CC], [AC_PROG_CC])
-# m4_require([AC_CHECK_HEADERS(limits.h)], [AC_CHECK_HEADERS(limits.h)])
+# m4_require([AC_CHECK_HEADERS(threads.h)], [AC_CHECK_HEADERS(threads.h)])
# which is just the same as
# m4_require([AC_PROG_CC])
-# m4_require([AC_CHECK_HEADERS(limits.h)])
+# m4_require([AC_CHECK_HEADERS(threads.h)])
#
# - BODY-TO-EXPAND == m4_indir([NAME-TO-CHECK])
# In the case of macros with irregular names. For instance: