From patchwork Tue Feb 12 11:57:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: RFA: v3 PATCH to add on_quick_exit/quick_exit to std Date: Tue, 12 Feb 2013 01:57:56 -0000 From: Paolo Carlini X-Patchwork-Id: 219833 Message-Id: <511A2E44.2090404@oracle.com> To: dominiq@lps.ens.fr Cc: libstdc++@gcc.gnu.org, jason@redhat.com, gcc-patches@gcc.gnu.org, bkoz@redhat.com On 02/12/2013 12:40 PM, dominiq@lps.ens.fr wrote: > IIRC I have already asked a similar question about atan2, erf, ... > which don't appear in the std namespace on darwin. You should check whether darwin by chance uses by default c_std instead of c_global. The former doesn't provide C++11 facilities. If, on the other hand, it uses c_global, it means _GLIBCXX_USE_C99_MATH_TR1 is undefined because a configure test fails on that specific darwin release you are using. But the last time I checked, modern darwin defined _GLIBCXX_USE_C99_MATH_TR1, no problems. Anyway, about the cstdlib issue the below makes available the new functions in c_std/cstdlib too, and I'm going to commit it, it's close to what Jason originally committed. But, as I said already we don't normally provide C++11 functions in c_std, Benjamin may want to review what we are doing in c_std vs c_global, he designed the split. Paolo. ////// Index: include/c_std/cstdlib =================================================================== --- include/c_std/cstdlib (revision 195968) +++ include/c_std/cstdlib (working copy) @@ -57,6 +57,14 @@ 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 #else @@ -67,6 +75,11 @@ #undef abort #undef abs #undef atexit +#if __cplusplus >= 201103L +# ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT +# undef at_quick_exit +# endif +#endif #undef atof #undef atoi #undef atol @@ -83,6 +96,11 @@ #undef mbstowcs #undef mbtowc #undef qsort +#if __cplusplus >= 201103L +# ifdef _GLIBCXX_HAVE_QUICK_EXIT +# undef quick_exit +# endif +#endif #undef rand #undef realloc #undef srand @@ -103,6 +121,11 @@ using ::abort; using ::abs; using ::atexit; +#if __cplusplus >= 201103L +# ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT + using ::at_quick_exit; +# endif +#endif using ::atof; using ::atoi; using ::atol; @@ -121,6 +144,11 @@ using ::mbtowc; #endif // _GLIBCXX_HAVE_MBSTATE_T using ::qsort; +#if __cplusplus >= 201103L +# ifdef _GLIBCXX_HAVE_QUICK_EXIT + using ::quick_exit; +# endif +#endif using ::rand; using ::realloc; using ::srand;