linkage.m4 (GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE): New.

* linkage.m4 (GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE): New.
	(GLIBCXX_CHECK_STDLIB_SUPPORT): Check for atexit and at_quick_exit.
	* include/c_std/cstdlib: Add atexit and at_quick_exit.
	* include/c_global/cstdlib: Add atexit and at_quick_exit.
	* testsuite/18_support/quick_exit/quick_exit.cc: New.

From-SVN: r195948
This commit is contained in:
Jason Merrill 2013-02-11 12:50:13 -05:00 committed by Jason Merrill
parent b63fe0076d
commit cc999d0300
7 changed files with 1033 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2013-02-11 Jason Merrill <jason@redhat.com>
* linkage.m4 (GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE): New.
(GLIBCXX_CHECK_STDLIB_SUPPORT): Check for atexit and at_quick_exit.
* config.h.in, configure: Regenerate.
* include/c_std/cstdlib: Add atexit and at_quick_exit.
* include/c_global/cstdlib: Add atexit and at_quick_exit.
* testsuite/18_support/quick_exit/quick_exit.cc: New.
2013-02-11 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/56282

View File

@ -27,6 +27,9 @@
/* Define to 1 if you have the `atanl' function. */
#undef HAVE_ATANL
/* Define to 1 if you have the `at_quick_exit' function. */
#undef HAVE_AT_QUICK_EXIT
/* Define to 1 if the target assembler supports thread-local storage. */
#undef HAVE_CC_TLS
@ -303,6 +306,9 @@
/* Define to 1 if you have the `qfpclass' function. */
#undef HAVE_QFPCLASS
/* Define to 1 if you have the `quick_exit' function. */
#undef HAVE_QUICK_EXIT
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV

928
libstdc++-v3/configure vendored
View File

@ -26223,6 +26223,122 @@ done
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for at_quick_exit declaration" >&5
$as_echo_n "checking for at_quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_at_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_at_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
at_quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_at_quick_exit_use=yes
else
glibcxx_cv_func_at_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_at_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_at_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_at_quick_exit_use = x"yes"; then
for ac_func in at_quick_exit
do :
ac_fn_c_check_func "$LINENO" "at_quick_exit" "ac_cv_func_at_quick_exit"
if test "x$ac_cv_func_at_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_AT_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quick_exit declaration" >&5
$as_echo_n "checking for quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_quick_exit_use=yes
else
glibcxx_cv_func_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_quick_exit_use = x"yes"; then
for ac_func in quick_exit
do :
ac_fn_c_check_func "$LINENO" "quick_exit" "ac_cv_func_quick_exit"
if test "x$ac_cv_func_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtold declaration" >&5
$as_echo_n "checking for strtold declaration... " >&6; }
if test x${glibcxx_cv_func_strtold_use+set} != xset; then
@ -33125,6 +33241,122 @@ done
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for at_quick_exit declaration" >&5
$as_echo_n "checking for at_quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_at_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_at_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
at_quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_at_quick_exit_use=yes
else
glibcxx_cv_func_at_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_at_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_at_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_at_quick_exit_use = x"yes"; then
for ac_func in at_quick_exit
do :
ac_fn_c_check_func "$LINENO" "at_quick_exit" "ac_cv_func_at_quick_exit"
if test "x$ac_cv_func_at_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_AT_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quick_exit declaration" >&5
$as_echo_n "checking for quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_quick_exit_use=yes
else
glibcxx_cv_func_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_quick_exit_use = x"yes"; then
for ac_func in quick_exit
do :
ac_fn_c_check_func "$LINENO" "quick_exit" "ac_cv_func_quick_exit"
if test "x$ac_cv_func_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtold declaration" >&5
$as_echo_n "checking for strtold declaration... " >&6; }
if test x${glibcxx_cv_func_strtold_use+set} != xset; then
@ -38940,6 +39172,122 @@ done
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for at_quick_exit declaration" >&5
$as_echo_n "checking for at_quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_at_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_at_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
at_quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_at_quick_exit_use=yes
else
glibcxx_cv_func_at_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_at_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_at_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_at_quick_exit_use = x"yes"; then
for ac_func in at_quick_exit
do :
ac_fn_c_check_func "$LINENO" "at_quick_exit" "ac_cv_func_at_quick_exit"
if test "x$ac_cv_func_at_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_AT_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quick_exit declaration" >&5
$as_echo_n "checking for quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_quick_exit_use=yes
else
glibcxx_cv_func_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_quick_exit_use = x"yes"; then
for ac_func in quick_exit
do :
ac_fn_c_check_func "$LINENO" "quick_exit" "ac_cv_func_quick_exit"
if test "x$ac_cv_func_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtold declaration" >&5
$as_echo_n "checking for strtold declaration... " >&6; }
if test x${glibcxx_cv_func_strtold_use+set} != xset; then
@ -44770,6 +45118,122 @@ done
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for at_quick_exit declaration" >&5
$as_echo_n "checking for at_quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_at_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_at_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
at_quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_at_quick_exit_use=yes
else
glibcxx_cv_func_at_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_at_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_at_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_at_quick_exit_use = x"yes"; then
for ac_func in at_quick_exit
do :
ac_fn_c_check_func "$LINENO" "at_quick_exit" "ac_cv_func_at_quick_exit"
if test "x$ac_cv_func_at_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_AT_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quick_exit declaration" >&5
$as_echo_n "checking for quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_quick_exit_use=yes
else
glibcxx_cv_func_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_quick_exit_use = x"yes"; then
for ac_func in quick_exit
do :
ac_fn_c_check_func "$LINENO" "quick_exit" "ac_cv_func_quick_exit"
if test "x$ac_cv_func_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtold declaration" >&5
$as_echo_n "checking for strtold declaration... " >&6; }
if test x${glibcxx_cv_func_strtold_use+set} != xset; then
@ -51274,6 +51738,122 @@ done
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for at_quick_exit declaration" >&5
$as_echo_n "checking for at_quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_at_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_at_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
at_quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_at_quick_exit_use=yes
else
glibcxx_cv_func_at_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_at_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_at_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_at_quick_exit_use = x"yes"; then
for ac_func in at_quick_exit
do :
ac_fn_c_check_func "$LINENO" "at_quick_exit" "ac_cv_func_at_quick_exit"
if test "x$ac_cv_func_at_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_AT_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quick_exit declaration" >&5
$as_echo_n "checking for quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_quick_exit_use=yes
else
glibcxx_cv_func_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_quick_exit_use = x"yes"; then
for ac_func in quick_exit
do :
ac_fn_c_check_func "$LINENO" "quick_exit" "ac_cv_func_quick_exit"
if test "x$ac_cv_func_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtold declaration" >&5
$as_echo_n "checking for strtold declaration... " >&6; }
if test x${glibcxx_cv_func_strtold_use+set} != xset; then
@ -57443,6 +58023,122 @@ done
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for at_quick_exit declaration" >&5
$as_echo_n "checking for at_quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_at_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_at_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
at_quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_at_quick_exit_use=yes
else
glibcxx_cv_func_at_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_at_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_at_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_at_quick_exit_use = x"yes"; then
for ac_func in at_quick_exit
do :
ac_fn_c_check_func "$LINENO" "at_quick_exit" "ac_cv_func_at_quick_exit"
if test "x$ac_cv_func_at_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_AT_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quick_exit declaration" >&5
$as_echo_n "checking for quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_quick_exit_use=yes
else
glibcxx_cv_func_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_quick_exit_use = x"yes"; then
for ac_func in quick_exit
do :
ac_fn_c_check_func "$LINENO" "quick_exit" "ac_cv_func_quick_exit"
if test "x$ac_cv_func_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtold declaration" >&5
$as_echo_n "checking for strtold declaration... " >&6; }
if test x${glibcxx_cv_func_strtold_use+set} != xset; then
@ -63638,6 +64334,122 @@ done
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for at_quick_exit declaration" >&5
$as_echo_n "checking for at_quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_at_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_at_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
at_quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_at_quick_exit_use=yes
else
glibcxx_cv_func_at_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_at_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_at_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_at_quick_exit_use = x"yes"; then
for ac_func in at_quick_exit
do :
ac_fn_c_check_func "$LINENO" "at_quick_exit" "ac_cv_func_at_quick_exit"
if test "x$ac_cv_func_at_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_AT_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quick_exit declaration" >&5
$as_echo_n "checking for quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_quick_exit_use=yes
else
glibcxx_cv_func_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_quick_exit_use = x"yes"; then
for ac_func in quick_exit
do :
ac_fn_c_check_func "$LINENO" "quick_exit" "ac_cv_func_quick_exit"
if test "x$ac_cv_func_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtold declaration" >&5
$as_echo_n "checking for strtold declaration... " >&6; }
if test x${glibcxx_cv_func_strtold_use+set} != xset; then
@ -69506,6 +70318,122 @@ done
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for at_quick_exit declaration" >&5
$as_echo_n "checking for at_quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_at_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_at_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
at_quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_at_quick_exit_use=yes
else
glibcxx_cv_func_at_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_at_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_at_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_at_quick_exit_use = x"yes"; then
for ac_func in at_quick_exit
do :
ac_fn_c_check_func "$LINENO" "at_quick_exit" "ac_cv_func_at_quick_exit"
if test "x$ac_cv_func_at_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_AT_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quick_exit declaration" >&5
$as_echo_n "checking for quick_exit declaration... " >&6; }
if test x${glibcxx_cv_func_quick_exit_use+set} != xset; then
if test "${glibcxx_cv_func_quick_exit_use+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
int
main ()
{
quick_exit(0);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
glibcxx_cv_func_quick_exit_use=yes
else
glibcxx_cv_func_quick_exit_use=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_quick_exit_use" >&5
$as_echo "$glibcxx_cv_func_quick_exit_use" >&6; }
if test x$glibcxx_cv_func_quick_exit_use = x"yes"; then
for ac_func in quick_exit
do :
ac_fn_c_check_func "$LINENO" "quick_exit" "ac_cv_func_quick_exit"
if test "x$ac_cv_func_quick_exit" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_QUICK_EXIT 1
_ACEOF
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtold declaration" >&5
$as_echo_n "checking for strtold declaration... " >&6; }
if test x${glibcxx_cv_func_strtold_use+set} != xset; then

View File

@ -57,6 +57,8 @@ namespace std
extern "C" void abort(void) throw () _GLIBCXX_NORETURN;
extern "C" int atexit(void (*)()) throw ();
extern "C" void exit(int) throw () _GLIBCXX_NORETURN;
extern "C" int at_quick_exit(void (*)()) throw ();
extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN;
} // namespace std
#else
@ -67,6 +69,7 @@ namespace std
#undef abort
#undef abs
#undef atexit
#undef at_quick_exit
#undef atof
#undef atoi
#undef atol
@ -83,6 +86,7 @@ namespace std
#undef mbstowcs
#undef mbtowc
#undef qsort
#undef quick_exit
#undef rand
#undef realloc
#undef srand
@ -103,6 +107,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::abort;
using ::abs;
using ::atexit;
#ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT
using ::at_quick_exit;
#endif
using ::atof;
using ::atoi;
using ::atol;
@ -121,6 +128,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::mbtowc;
#endif // _GLIBCXX_HAVE_MBSTATE_T
using ::qsort;
#ifdef _GLIBCXX_HAVE_QUICK_EXIT
using ::quick_exit;
#endif
using ::rand;
using ::realloc;
using ::srand;

View File

@ -57,6 +57,8 @@ namespace std
extern "C" void abort(void) throw () _GLIBCXX_NORETURN;
extern "C" int atexit(void (*)()) throw ();
extern "C" void exit(int) throw () _GLIBCXX_NORETURN;
extern "C" int at_quick_exit(void (*)()) throw ();
extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN;
} // namespace
#else
@ -67,6 +69,7 @@ namespace std
#undef abort
#undef abs
#undef atexit
#undef at_quick_exit
#undef atof
#undef atoi
#undef atol
@ -83,6 +86,7 @@ namespace std
#undef mbstowcs
#undef mbtowc
#undef qsort
#undef quick_exit
#undef rand
#undef realloc
#undef srand
@ -103,6 +107,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::abort;
using ::abs;
using ::atexit;
#ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT
using ::at_quick_exit;
#endif
using ::atof;
using ::atoi;
using ::atol;
@ -121,6 +128,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::mbtowc;
#endif // _GLIBCXX_HAVE_MBSTATE_T
using ::qsort;
#ifdef _GLIBCXX_HAVE_QUICK_EXIT
using ::quick_exit;
#endif
using ::rand;
using ::realloc;
using ::srand;

View File

@ -232,6 +232,35 @@ AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0], [
])
dnl
dnl Check to see if the (stdlib function) argument passed is
dnl 1) declared when using the c++ compiler
dnl 2) has "C" linkage
dnl
dnl argument 1 is name of function to check
dnl
dnl ASSUMES argument is a stdlib function with ONE parameter
dnl
dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_1
AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_1], [
AC_MSG_CHECKING([for $1 declaration])
if test x${glibcxx_cv_func_$1_use+set} != xset; then
AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <stdlib.h>],
[ $1(0);],
[glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
AC_LANG_RESTORE
])
fi
AC_MSG_RESULT($glibcxx_cv_func_$1_use)
if test x$glibcxx_cv_func_$1_use = x"yes"; then
AC_CHECK_FUNCS($1)
fi
])
dnl
dnl Check to see if the (stdlib function) argument passed is
dnl 1) declared when using the c++ compiler
@ -306,6 +335,8 @@ AC_DEFUN([GLIBCXX_CHECK_STDLIB_SUPPORT], [
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_1(at_quick_exit)
GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_1(quick_exit)
GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)

View File

@ -0,0 +1,39 @@
// 2013-02-11 Jason Merrill
// Copyright (C) 2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 18.5 - Start and termination
#include <cstdlib>
void handler()
{
std::_Exit(0);
}
void wrong_handler()
{
std::abort();
}
int main()
{
std::at_quick_exit (handler);
std::atexit (wrong_handler);
std::quick_exit (1);
}