diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-02-11 23:42:43 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-02-11 23:42:43 +0000 |
commit | 42906f794048d6e3a027a6ce1d8f47cdb37a5a52 (patch) | |
tree | 4e003d8edff0469a1c9b46de5802c1c04d5857d2 /libstdc++-v3 | |
parent | 6c59ffd1ac3a56fc1819282ce820ec8d95922f38 (diff) | |
download | gcc-42906f794048d6e3a027a6ce1d8f47cdb37a5a52.zip gcc-42906f794048d6e3a027a6ce1d8f47cdb37a5a52.tar.gz gcc-42906f794048d6e3a027a6ce1d8f47cdb37a5a52.tar.bz2 |
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
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 11 | ||||
-rw-r--r-- | libstdc++-v3/include/c_global/cstdlib | 26 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/cstdlib | 10 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/18_support/quick_exit/quick_exit.cc | 8 |
4 files changed, 38 insertions, 17 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 38f41af..096fd68 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,7 +1,16 @@ +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> * doc/html/*: Regenerate. - + 2013-02-11 Jason Merrill <jason@redhat.com> * linkage.m4 (GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE): New. diff --git a/libstdc++-v3/include/c_global/cstdlib b/libstdc++-v3/include/c_global/cstdlib index 0eb0129..9180036 100644 --- a/libstdc++-v3/include/c_global/cstdlib +++ b/libstdc++-v3/include/c_global/cstdlib @@ -57,8 +57,14 @@ namespace std extern "C" void abort(void) throw () _GLIBCXX_NORETURN; extern "C" int atexit(void (*)()) throw (); 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 (); +# endif +# ifdef _GLIBCXX_HAVE_QUICK_EXIT extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN; +# endif +#endif } // namespace std #else @@ -69,7 +75,11 @@ namespace std #undef abort #undef abs #undef atexit -#undef at_quick_exit +#if __cplusplus >= 201103L +# ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT +# undef at_quick_exit +# endif +#endif #undef atof #undef atoi #undef atol @@ -86,7 +96,11 @@ namespace std #undef mbstowcs #undef mbtowc #undef qsort -#undef quick_exit +#if __cplusplus >= 201103L +# ifdef _GLIBCXX_HAVE_QUICK_EXIT +# undef quick_exit +# endif +#endif #undef rand #undef realloc #undef srand @@ -107,8 +121,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::abort; using ::abs; using ::atexit; -#ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT +#if __cplusplus >= 201103L +# ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT using ::at_quick_exit; +# endif #endif using ::atof; using ::atoi; @@ -128,8 +144,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::mbtowc; #endif // _GLIBCXX_HAVE_MBSTATE_T using ::qsort; -#ifdef _GLIBCXX_HAVE_QUICK_EXIT +#if __cplusplus >= 201103L +# ifdef _GLIBCXX_HAVE_QUICK_EXIT using ::quick_exit; +# endif #endif using ::rand; using ::realloc; diff --git a/libstdc++-v3/include/c_std/cstdlib b/libstdc++-v3/include/c_std/cstdlib index 9d2f51e..224fccf 100644 --- a/libstdc++-v3/include/c_std/cstdlib +++ b/libstdc++-v3/include/c_std/cstdlib @@ -57,8 +57,6 @@ 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 @@ -69,7 +67,6 @@ namespace std #undef abort #undef abs #undef atexit -#undef at_quick_exit #undef atof #undef atoi #undef atol @@ -86,7 +83,6 @@ namespace std #undef mbstowcs #undef mbtowc #undef qsort -#undef quick_exit #undef rand #undef realloc #undef srand @@ -107,9 +103,6 @@ _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; @@ -128,9 +121,6 @@ _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; diff --git a/libstdc++-v3/testsuite/18_support/quick_exit/quick_exit.cc b/libstdc++-v3/testsuite/18_support/quick_exit/quick_exit.cc index 54ee41e..8e55890 100644 --- a/libstdc++-v3/testsuite/18_support/quick_exit/quick_exit.cc +++ b/libstdc++-v3/testsuite/18_support/quick_exit/quick_exit.cc @@ -1,5 +1,7 @@ -// 2013-02-11 Jason Merrill - +// { dg-options "-std=gnu++11" } +// +// 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 @@ -33,7 +35,9 @@ void wrong_handler() int main() { +#if defined(_GLIBCXX_HAVE_AT_QUICK_EXIT) && defined(_GLIBCXX_HAVE_QUICK_EXIT) std::at_quick_exit (handler); std::atexit (wrong_handler); std::quick_exit (1); +#endif } |