Commit 42906f79 by Paolo Carlini Committed by Paolo Carlini

cstdlib (at_quick_exit, quick_exit): Do not declare.

2013-02-11  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/c_std/cstdlib (at_quick_exit, quick_exit): Do not declare.
	* include/c_global/cstdlib (at_quick_exit, quick_exit): Declare only
	in C++11 mode and if available in the underlying C library.
	* testsuite/18_support/quick_exit/quick_exit.cc: Compile with
	-std=gnu++11; check _GLIBCXX_HAVE_AT_QUICK_EXIT and
	_GLIBCXX_HAVE_QUICK_EXIT.

From-SVN: r195961
parent 6c59ffd1
2013-02-11 Paolo Carlini <paolo.carlini@oracle.com>
* include/c_std/cstdlib (at_quick_exit, quick_exit): Do not declare.
* include/c_global/cstdlib (at_quick_exit, quick_exit): Declare only
in C++11 mode and if available in the underlying C library.
* testsuite/18_support/quick_exit/quick_exit.cc: Compile with
-std=gnu++11; check _GLIBCXX_HAVE_AT_QUICK_EXIT and
_GLIBCXX_HAVE_QUICK_EXIT.
2013-02-11 Benjamin Kosnik <bkoz@redhat.com> 2013-02-11 Benjamin Kosnik <bkoz@redhat.com>
* doc/html/*: Regenerate. * doc/html/*: Regenerate.
2013-02-11 Jason Merrill <jason@redhat.com> 2013-02-11 Jason Merrill <jason@redhat.com>
* linkage.m4 (GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE): New. * linkage.m4 (GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE): New.
......
...@@ -57,8 +57,14 @@ namespace std ...@@ -57,8 +57,14 @@ namespace std
extern "C" void abort(void) throw () _GLIBCXX_NORETURN; extern "C" void abort(void) throw () _GLIBCXX_NORETURN;
extern "C" int atexit(void (*)()) throw (); extern "C" int atexit(void (*)()) throw ();
extern "C" void exit(int) throw () _GLIBCXX_NORETURN; extern "C" void exit(int) throw () _GLIBCXX_NORETURN;
#if __cplusplus >= 201103L
# ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT
extern "C" int at_quick_exit(void (*)()) throw (); extern "C" int at_quick_exit(void (*)()) throw ();
# endif
# ifdef _GLIBCXX_HAVE_QUICK_EXIT
extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN; extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN;
# endif
#endif
} // namespace std } // namespace std
#else #else
...@@ -69,7 +75,11 @@ namespace std ...@@ -69,7 +75,11 @@ namespace std
#undef abort #undef abort
#undef abs #undef abs
#undef atexit #undef atexit
#undef at_quick_exit #if __cplusplus >= 201103L
# ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT
# undef at_quick_exit
# endif
#endif
#undef atof #undef atof
#undef atoi #undef atoi
#undef atol #undef atol
...@@ -86,7 +96,11 @@ namespace std ...@@ -86,7 +96,11 @@ namespace std
#undef mbstowcs #undef mbstowcs
#undef mbtowc #undef mbtowc
#undef qsort #undef qsort
#undef quick_exit #if __cplusplus >= 201103L
# ifdef _GLIBCXX_HAVE_QUICK_EXIT
# undef quick_exit
# endif
#endif
#undef rand #undef rand
#undef realloc #undef realloc
#undef srand #undef srand
...@@ -107,8 +121,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -107,8 +121,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::abort; using ::abort;
using ::abs; using ::abs;
using ::atexit; using ::atexit;
#ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT #if __cplusplus >= 201103L
# ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT
using ::at_quick_exit; using ::at_quick_exit;
# endif
#endif #endif
using ::atof; using ::atof;
using ::atoi; using ::atoi;
...@@ -128,8 +144,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -128,8 +144,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::mbtowc; using ::mbtowc;
#endif // _GLIBCXX_HAVE_MBSTATE_T #endif // _GLIBCXX_HAVE_MBSTATE_T
using ::qsort; using ::qsort;
#ifdef _GLIBCXX_HAVE_QUICK_EXIT #if __cplusplus >= 201103L
# ifdef _GLIBCXX_HAVE_QUICK_EXIT
using ::quick_exit; using ::quick_exit;
# endif
#endif #endif
using ::rand; using ::rand;
using ::realloc; using ::realloc;
......
...@@ -57,8 +57,6 @@ namespace std ...@@ -57,8 +57,6 @@ namespace std
extern "C" void abort(void) throw () _GLIBCXX_NORETURN; extern "C" void abort(void) throw () _GLIBCXX_NORETURN;
extern "C" int atexit(void (*)()) throw (); extern "C" int atexit(void (*)()) throw ();
extern "C" void exit(int) throw () _GLIBCXX_NORETURN; 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 } // namespace
#else #else
...@@ -69,7 +67,6 @@ namespace std ...@@ -69,7 +67,6 @@ namespace std
#undef abort #undef abort
#undef abs #undef abs
#undef atexit #undef atexit
#undef at_quick_exit
#undef atof #undef atof
#undef atoi #undef atoi
#undef atol #undef atol
...@@ -86,7 +83,6 @@ namespace std ...@@ -86,7 +83,6 @@ namespace std
#undef mbstowcs #undef mbstowcs
#undef mbtowc #undef mbtowc
#undef qsort #undef qsort
#undef quick_exit
#undef rand #undef rand
#undef realloc #undef realloc
#undef srand #undef srand
...@@ -107,9 +103,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -107,9 +103,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::abort; using ::abort;
using ::abs; using ::abs;
using ::atexit; using ::atexit;
#ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT
using ::at_quick_exit;
#endif
using ::atof; using ::atof;
using ::atoi; using ::atoi;
using ::atol; using ::atol;
...@@ -128,9 +121,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -128,9 +121,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::mbtowc; using ::mbtowc;
#endif // _GLIBCXX_HAVE_MBSTATE_T #endif // _GLIBCXX_HAVE_MBSTATE_T
using ::qsort; using ::qsort;
#ifdef _GLIBCXX_HAVE_QUICK_EXIT
using ::quick_exit;
#endif
using ::rand; using ::rand;
using ::realloc; using ::realloc;
using ::srand; using ::srand;
......
// 2013-02-11 Jason Merrill // { dg-options "-std=gnu++11" }
//
// 2013-02-11 Jason Merrill
//
// Copyright (C) 2013 Free Software Foundation, Inc. // Copyright (C) 2013 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -33,7 +35,9 @@ void wrong_handler() ...@@ -33,7 +35,9 @@ void wrong_handler()
int main() int main()
{ {
#if defined(_GLIBCXX_HAVE_AT_QUICK_EXIT) && defined(_GLIBCXX_HAVE_QUICK_EXIT)
std::at_quick_exit (handler); std::at_quick_exit (handler);
std::atexit (wrong_handler); std::atexit (wrong_handler);
std::quick_exit (1); std::quick_exit (1);
#endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment