+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.
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
#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
#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
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;
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;
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
#undef abort
#undef abs
#undef atexit
-#undef at_quick_exit
#undef atof
#undef atoi
#undef atol
#undef mbstowcs
#undef mbtowc
#undef qsort
-#undef quick_exit
#undef rand
#undef realloc
#undef srand
using ::abort;
using ::abs;
using ::atexit;
-#ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT
- using ::at_quick_exit;
-#endif
using ::atof;
using ::atoi;
using ::atol;
using ::mbtowc;
#endif // _GLIBCXX_HAVE_MBSTATE_T
using ::qsort;
-#ifdef _GLIBCXX_HAVE_QUICK_EXIT
- using ::quick_exit;
-#endif
using ::rand;
using ::realloc;
using ::srand;
-// 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
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
}