autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] stop using AC_HEADER_STDC


From: Adrian Bunk
Subject: [PATCH] stop using AC_HEADER_STDC
Date: Tue, 25 Sep 2012 15:25:07 +0300

AC_HEADER_STDC is documented to no longer be needed, so stop using it.

* lib/autoconf/functions.m4: stop using AC_HEADER_STDC in
_AC_FUNC_MALLOC_IF and _AC_FUNC_REALLOC_IF
* lib/autoconf/headers.m4: stop using AC_HEADER_STDC in
_AC_INCLUDES_DEFAULT_REQUIREMENTS
* doc/autoconf.texi: update the AC_INCLUDES_DEFAULT documentation
according to the _AC_INCLUDES_DEFAULT_REQUIREMENTS change
---
 doc/autoconf.texi         |   11 +++--------
 lib/autoconf/functions.m4 |   28 ++++------------------------
 lib/autoconf/headers.m4   |   10 ++--------
 3 files changed, 9 insertions(+), 40 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 2b4e614..0b07728 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -3885,14 +3885,9 @@ Expand to @var{include-directives} if defined, otherwise 
to:
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
 #include <stddef.h>
 #ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-#  include <memory.h>
-# endif
 # include <string.h>
 #endif
 #ifdef HAVE_STRINGS_H
@@ -3911,8 +3906,8 @@ Expand to @var{include-directives} if defined, otherwise 
to:
 @end example
 
 If the default includes are used, then check for the presence of these
-headers and their compatibility, i.e., you don't need to run
address@hidden, nor check for @file{stdlib.h} etc.
+headers and their compatibility, i.e., you don't need to check for
address@hidden/stat.h} etc.
 
 These headers are checked for in the same order as they are included.
 For instance, on some systems @file{string.h} and @file{strings.h} both
diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index de7a6b8..c2dfe85 100644
--- a/lib/autoconf/functions.m4
+++ b/lib/autoconf/functions.m4
@@ -905,18 +905,10 @@ fi
 # ------------------------------------
 # If `malloc (0)' properly handled, run IF-WORKS, otherwise, IF-NOT.
 AC_DEFUN([_AC_FUNC_MALLOC_IF],
-[AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
-AC_CHECK_HEADERS(stdlib.h)
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
 AC_CACHE_CHECK([for GNU libc compatible malloc], ac_cv_func_malloc_0_nonnull,
 [AC_RUN_IFELSE(
-[AC_LANG_PROGRAM(
-[[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *malloc ();
-#endif
-]],
+[AC_LANG_PROGRAM([[#include <stdlib.h>]],
                 [return ! malloc (0);])],
               [ac_cv_func_malloc_0_nonnull=yes],
               [ac_cv_func_malloc_0_nonnull=no],
@@ -1260,10 +1252,6 @@ AC_CACHE_CHECK([for working mmap], 
[ac_cv_func_mmap_fixed_mapped],
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
-char *malloc ();
-#endif
-
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
 # ifdef _SC_PAGESIZE
@@ -1424,18 +1412,10 @@ AU_ALIAS([AM_FUNC_OBSTACK], [AC_FUNC_OBSTACK])
 # -------------------------------------
 # If `realloc (0, 0)' is properly handled, run IF-WORKS, otherwise, IF-NOT.
 AC_DEFUN([_AC_FUNC_REALLOC_IF],
-[AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
-AC_CHECK_HEADERS(stdlib.h)
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
 AC_CACHE_CHECK([for GNU libc compatible realloc], ac_cv_func_realloc_0_nonnull,
 [AC_RUN_IFELSE(
-[AC_LANG_PROGRAM(
-[[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *realloc ();
-#endif
-]],
+[AC_LANG_PROGRAM([[#include <stdlib.h>]],
                 [return ! realloc (0, 0);])],
               [ac_cv_func_realloc_0_nonnull=yes],
               [ac_cv_func_realloc_0_nonnull=no],
diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
index 58a2778..949beb7 100644
--- a/lib/autoconf/headers.m4
+++ b/lib/autoconf/headers.m4
@@ -306,14 +306,9 @@ ac_includes_default="\
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
 #include <stddef.h>
 #ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-#  include <memory.h>
-# endif
 # include <string.h>
 #endif
 #ifdef HAVE_STRINGS_H
@@ -329,9 +324,8 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 ])dnl
-AC_REQUIRE([AC_HEADER_STDC])dnl
 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
-AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+AC_CHECK_HEADERS([sys/types.h sys/stat.h string.h strings.h \
                  inttypes.h stdint.h unistd.h],
                 [], [], $ac_includes_default)
 ])# _AC_INCLUDES_DEFAULT_REQUIREMENTS
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]