summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-18 07:40:22 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-18 07:40:22 -0800
commitcf1f8b1efacc53f86fd871b5d3e8d65a373406b8 (patch)
tree291817939854656de153a56dae865ecb15d931ae
parentd7624c5078e351ce77f68a1dc492627a36aa04d0 (diff)
downloadautoconf213-cf1f8b1efacc53f86fd871b5d3e8d65a373406b8.tar.gz
autoconf213-cf1f8b1efacc53f86fd871b5d3e8d65a373406b8.tar.bz2
autoconf213-cf1f8b1efacc53f86fd871b5d3e8d65a373406b8.zip
autoconf-2.13-c++exit
-rw-r--r--acgeneral.m44
-rw-r--r--acspecific.m433
2 files changed, 33 insertions, 4 deletions
diff --git a/acgeneral.m4 b/acgeneral.m4
index ae971de..69600f8 100644
--- a/acgeneral.m4
+++ b/acgeneral.m4
@@ -1817,10 +1817,6 @@ AC_DEFUN(AC_TRY_RUN_NATIVE,
[cat > conftest.$ac_ext <<EOF
[#]line __oline__ "configure"
#include "confdefs.h"
-ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
-extern "C" void exit(int);
-#endif
-])dnl
[$1]
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
diff --git a/acspecific.m4 b/acspecific.m4
index 8609f07..8fc485a 100644
--- a/acspecific.m4
+++ b/acspecific.m4
@@ -152,8 +152,41 @@ else
CXXFLAGS=
fi
fi
+
+AC_PROG_CXX_EXIT_DECLARATION
])
+
+# AC_PROG_CXX_EXIT_DECLARATION
+# -----------------------------
+# Find a valid prototype for exit and declare it in confdefs.h.
+AC_DEFUN(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);'
+do
+ AC_TRY_COMPILE([#include <stdlib.h>
+$ac_declaration],
+ [exit (42);],
+ [],
+ [continue])
+ AC_TRY_COMPILE([$ac_declaration],
+ [exit (42);],
+ [break])
+done
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+])# AC_PROG_CXX_EXIT_DECLARATION
+
+
dnl Determine a Fortran 77 compiler to use. If `F77' is not already set
dnl in the environment, check for `g77', `f77' and `f2c', in that order.
dnl Set the output variable `F77' to the name of the compiler found.