[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
_AC_PROG_CXX_EXIT_DECLARATION: don't `#include <stdlib.h>'
From: |
Jim Meyering |
Subject: |
_AC_PROG_CXX_EXIT_DECLARATION: don't `#include <stdlib.h>' |
Date: |
Thu, 22 May 2003 18:02:39 +0200 |
If anyone knows of a system on which <stdlib.h> (or any other header)
should be included from confdefs.h (later known as config.h),
please speak up now.
This change makes it so that when running configure with e.g., CC=aCC,
you'll now get this in confdefs.h:
#ifdef __cplusplus
extern "C" void exit (int);
#endif
rather than this:
#ifdef __cplusplus
#include <stdlib.h>
#endif
which would cause things like AC_REPLACE_FUNCS(getopt)
mistakenly to replace getopt on systems that already provide it.
Jim
2003-05-22 Jim Meyering <address@hidden>
* lib/autoconf/c.m4 (_AC_PROG_CXX_EXIT_DECLARATION): Remove
`#include <stdlib.h>' from the list; we should never make
confdefs.h include <stdlib.h> or <cstdlib>, because the resulting
namespace pollution would cause other tests to fail. Configure scripts
run with some older versions of g++ and HP's aCC would fail due to
such an #include. Reports here http://bugs.debian.org/120704 and
here http://mail.gnu.org/archive/html/autoconf/2003-05/msg00063.html.
Index: lib/autoconf/c.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.177
diff -u -p -u -5 -r1.177 c.m4
--- lib/autoconf/c.m4 14 Apr 2003 03:47:30 -0000 1.177
+++ lib/autoconf/c.m4 22 May 2003 15:57:12 -0000
@@ -721,15 +721,15 @@ fi[]dnl
])# _AC_PROG_CXX_G
# _AC_PROG_CXX_EXIT_DECLARATION
# -----------------------------
-# Find a valid prototype for exit and declare it in confdefs.h.
+# If <stdlib.h> doesn't already provide a valid prototype for exit,
+# determine the appropriate prototype and put it in confdefs.h.
m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
[for ac_declaration in \
''\
- '#include <stdlib.h>' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
'extern "C" void exit (int);' \
'void exit (int);'
- _AC_PROG_CXX_EXIT_DECLARATION: don't `#include <stdlib.h>',
Jim Meyering <=