From: Jim Meyering Date: Fri, 23 May 2003 09:36:17 +0000 (+0000) Subject: (_AC_PROG_CXX_EXIT_DECLARATION): X-Git-Tag: AUTOCONF-2.57a~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1512240def0ad68873788a4b2d1a9fcd414b8aff;p=thirdparty%2Fautoconf.git (_AC_PROG_CXX_EXIT_DECLARATION): Remove `#include ' from the list; we should never make confdefs.h include or , 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. Problems reported by Matthew Mueller in and by Keith Bostic in . In the test, use the test declaration before including , as that's closer to how it'll be used. --- diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 3ef894e91..248bc644b 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -723,19 +723,24 @@ fi[]dnl # _AC_PROG_CXX_EXIT_DECLARATION # ----------------------------- -# Find a valid prototype for exit and declare it in confdefs.h. +# If doesn't already provide a valid prototype for exit, +# determine the appropriate prototype and put it in confdefs.h. +# This macro is run only when testing a C++ compiler, but it generates +# a prototype that is also appropriate for C compilers in order to +# support a mixed C/C++ configuration environment. +# We don't need to worry about this for C, since we include +# if it is available, and that method works for all C compilers. m4_define([_AC_PROG_CXX_EXIT_DECLARATION], [for ac_declaration in \ - ''\ - '#include ' \ + '' \ '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);' do - _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include -$ac_declaration], + _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration +@%:@include ], [exit (42);])], [], [continue])