From: John Marino Date: Sun, 15 Nov 2015 12:17:13 +0000 (+0100) Subject: libstdc++ (5.0): Modify to allow clang 3.6+ to used C99 functions X-Git-Tag: v4.5.0~78 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/838772be3c028f0cfd9fae5da181858e4199863a libstdc++ (5.0): Modify to allow clang 3.6+ to used C99 functions The "throw()" attributes in libstdc++ are unique to GCC, so when clang 3.6+ tries to use them, a prototype mismatch error comes up. This modification allows clang to use the entire libstdc++. --- diff --git a/contrib/gcc-5.0/README.DRAGONFLY b/contrib/gcc-5.0/README.DRAGONFLY index 64e3083219..fca2b592f2 100644 --- a/contrib/gcc-5.0/README.DRAGONFLY +++ b/contrib/gcc-5.0/README.DRAGONFLY @@ -35,3 +35,12 @@ Files added (They will be incorporated upstream) libstdc++-v3/config/locale/dragonfly/numeric_members.cc libstdc++-v3/config/locale/dragonfly/time_members.cc libstdc++-v3/config/locale/dragonfly/time_members.h + +To support clang's use of libstdc++ + libstdc++-v3/include/bits/c++config + libstdc++-v3/include/c_global/cstdio + libstdc++-v3/include/c_global/cstdlib + libstdc++-v3/include/c_global/cwchar + libstdc++-v3/include/c_std/cstdio + libstdc++-v3/include/c_std/cstdlib + libstdc++-v3/include/c_std/cwchar diff --git a/contrib/gcc-5.0/libstdc++-v3/include/bits/c++config b/contrib/gcc-5.0/libstdc++-v3/include/bits/c++config index ae3065feaa..afcb425ce4 100644 --- a/contrib/gcc-5.0/libstdc++-v3/include/bits/c++config +++ b/contrib/gcc-5.0/libstdc++-v3/include/bits/c++config @@ -30,6 +30,12 @@ #ifndef _GLIBCXX_CXX_CONFIG_H #define _GLIBCXX_CXX_CONFIG_H 1 +#ifdef __clang__ +#define _GTHROW +#else +#define _GTHROW throw() +#endif + // The current version of the C++ library in compressed ISO date format. #define __GLIBCXX__ diff --git a/contrib/gcc-5.0/libstdc++-v3/include/c_global/cstdio b/contrib/gcc-5.0/libstdc++-v3/include/c_global/cstdio index d1c958b638..1d7127dd13 100644 --- a/contrib/gcc-5.0/libstdc++-v3/include/c_global/cstdio +++ b/contrib/gcc-5.0/libstdc++-v3/include/c_global/cstdio @@ -159,16 +159,16 @@ namespace __gnu_cxx #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" int (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...) - throw (); + _GTHROW; extern "C" int (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list); extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list); extern "C" int (vsnprintf)(char * __restrict, std::size_t, const char * __restrict, - __gnuc_va_list) throw (); + __gnuc_va_list) _GTHROW; extern "C" int (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list) - throw (); + _GTHROW; #endif #if !_GLIBCXX_USE_C99_DYNAMIC diff --git a/contrib/gcc-5.0/libstdc++-v3/include/c_global/cstdlib b/contrib/gcc-5.0/libstdc++-v3/include/c_global/cstdlib index 7e9bb30f05..c99026e667 100644 --- a/contrib/gcc-5.0/libstdc++-v3/include/c_global/cstdlib +++ b/contrib/gcc-5.0/libstdc++-v3/include/c_global/cstdlib @@ -54,15 +54,15 @@ namespace std { - extern "C" void abort(void) throw () _GLIBCXX_NORETURN; - extern "C" int atexit(void (*)(void)) throw (); - extern "C" void exit(int) throw () _GLIBCXX_NORETURN; + extern "C" void abort(void) _GTHROW _GLIBCXX_NORETURN; + extern "C" int atexit(void (*)(void)) _GTHROW; + extern "C" void exit(int) _GTHROW _GLIBCXX_NORETURN; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT - extern "C" int at_quick_exit(void (*)(void)) throw (); + extern "C" int at_quick_exit(void (*)(void)) _GTHROW; # endif # ifdef _GLIBCXX_HAVE_QUICK_EXIT - extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN; + extern "C" void quick_exit(int) _GTHROW _GLIBCXX_NORETURN; # endif #endif } // namespace std @@ -214,7 +214,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::lldiv_t; #endif #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC - extern "C" void (_Exit)(int) throw () _GLIBCXX_NORETURN; + extern "C" void (_Exit)(int) _GTHROW _GLIBCXX_NORETURN; #endif #if !_GLIBCXX_USE_C99_DYNAMIC using ::_Exit; @@ -231,11 +231,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - extern "C" long long int (atoll)(const char *) throw (); + extern "C" long long int (atoll)(const char *) _GTHROW; extern "C" long long int - (strtoll)(const char * __restrict, char ** __restrict, int) throw (); + (strtoll)(const char * __restrict, char ** __restrict, int) _GTHROW; extern "C" unsigned long long int - (strtoull)(const char * __restrict, char ** __restrict, int) throw (); + (strtoull)(const char * __restrict, char ** __restrict, int) _GTHROW; #endif #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::atoll; diff --git a/contrib/gcc-5.0/libstdc++-v3/include/c_global/cwchar b/contrib/gcc-5.0/libstdc++-v3/include/c_global/cwchar index dddb4092bb..f31957ef52 100644 --- a/contrib/gcc-5.0/libstdc++-v3/include/c_global/cwchar +++ b/contrib/gcc-5.0/libstdc++-v3/include/c_global/cwchar @@ -242,16 +242,16 @@ namespace __gnu_cxx { #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" long double - (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw (); + (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) _GTHROW; #endif #if !_GLIBCXX_USE_C99_DYNAMIC using ::wcstold; #endif #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC extern "C" long long int - (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); + (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) _GTHROW; extern "C" unsigned long long int - (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); + (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) _GTHROW; #endif #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::wcstoll; diff --git a/contrib/gcc-5.0/libstdc++-v3/include/c_std/cstdio b/contrib/gcc-5.0/libstdc++-v3/include/c_std/cstdio index 37f01cad70..7d6166a78d 100644 --- a/contrib/gcc-5.0/libstdc++-v3/include/c_std/cstdio +++ b/contrib/gcc-5.0/libstdc++-v3/include/c_std/cstdio @@ -157,16 +157,16 @@ namespace __gnu_cxx #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" int (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...) - throw (); + _GTHROW; extern "C" int (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list); extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list); extern "C" int (vsnprintf)(char * __restrict, std::size_t, const char * __restrict, - __gnuc_va_list) throw (); + __gnuc_va_list) _GTHROW; extern "C" int (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list) - throw (); + _GTHROW; #endif #if !_GLIBCXX_USE_C99_DYNAMIC diff --git a/contrib/gcc-5.0/libstdc++-v3/include/c_std/cstdlib b/contrib/gcc-5.0/libstdc++-v3/include/c_std/cstdlib index 0bd70589ee..edadab990e 100644 --- a/contrib/gcc-5.0/libstdc++-v3/include/c_std/cstdlib +++ b/contrib/gcc-5.0/libstdc++-v3/include/c_std/cstdlib @@ -54,15 +54,15 @@ namespace std { - extern "C" void abort(void) throw () _GLIBCXX_NORETURN; - extern "C" int atexit(void (*)(void)) throw (); - extern "C" void exit(int) throw () _GLIBCXX_NORETURN; + extern "C" void abort(void) _GTHROW _GLIBCXX_NORETURN; + extern "C" int atexit(void (*)(void)) _GTHROW; + extern "C" void exit(int) _GTHROW _GLIBCXX_NORETURN; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT - extern "C" int at_quick_exit(void (*)(void)) throw (); + extern "C" int at_quick_exit(void (*)(void)) _GTHROW; # endif # ifdef _GLIBCXX_HAVE_QUICK_EXIT - extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN; + extern "C" void quick_exit(int) _GTHROW _GLIBCXX_NORETURN; # endif #endif } // namespace @@ -211,7 +211,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::lldiv_t; #endif #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC - extern "C" void (_Exit)(int) throw () _GLIBCXX_NORETURN; + extern "C" void (_Exit)(int) _GTHROW _GLIBCXX_NORETURN; #endif #if !_GLIBCXX_USE_C99_DYNAMIC using ::_Exit; @@ -228,11 +228,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - extern "C" long long int (atoll)(const char *) throw (); + extern "C" long long int (atoll)(const char *) _GTHROW; extern "C" long long int - (strtoll)(const char * __restrict, char ** __restrict, int) throw (); + (strtoll)(const char * __restrict, char ** __restrict, int) _GTHROW; extern "C" unsigned long long int - (strtoull)(const char * __restrict, char ** __restrict, int) throw (); + (strtoull)(const char * __restrict, char ** __restrict, int) _GTHROW; #endif #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::atoll; diff --git a/contrib/gcc-5.0/libstdc++-v3/include/c_std/cwchar b/contrib/gcc-5.0/libstdc++-v3/include/c_std/cwchar index aa1b2fa024..466481a7b7 100644 --- a/contrib/gcc-5.0/libstdc++-v3/include/c_std/cwchar +++ b/contrib/gcc-5.0/libstdc++-v3/include/c_std/cwchar @@ -238,16 +238,16 @@ namespace __gnu_cxx { #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" long double - (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw (); + (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) _GTHROW; #endif #if !_GLIBCXX_USE_C99_DYNAMIC using ::wcstold; #endif #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC extern "C" long long int - (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); + (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) _GTHROW; extern "C" unsigned long long int - (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); + (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) _GTHROW; #endif #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::wcstoll;