From 5345a1906a5dbdcbc7c528cb2400a4e78b441b0e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Dumont?= Date: Thu, 12 Dec 2019 07:23:34 +0000 Subject: [PATCH] libstdc++: Fix tr1 definition ambiguity in versioned namespace * include/tr1/cctype: Add _GLIBCXX_BEGIN_VERSION_NAMESPACE and _GLIBCXX_END_VERSION_NAMESPACE. * include/tr1/cfenv: Likewise. * include/tr1/cinttypes: Likewise. * include/tr1/cstdint: Likewise. * include/tr1/cstdio: Likewise. * include/tr1/cstdlib: Likewise. * include/tr1/cwchar: Likewise. * include/tr1/cwctype: Likewise. From-SVN: r279272 --- libstdc++-v3/ChangeLog | 10 ++++++++++ libstdc++-v3/include/tr1/cctype | 4 ++++ libstdc++-v3/include/tr1/cfenv | 4 ++++ libstdc++-v3/include/tr1/cinttypes | 4 ++++ libstdc++-v3/include/tr1/cstdint | 2 ++ libstdc++-v3/include/tr1/cstdio | 4 ++++ libstdc++-v3/include/tr1/cstdlib | 4 ++++ libstdc++-v3/include/tr1/cwchar | 4 ++++ libstdc++-v3/include/tr1/cwctype | 4 ++++ 9 files changed, 40 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e7639cdadcd..54377d89dbb 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,15 @@ 2019-12-12 François Dumont + * include/tr1/cctype: Add _GLIBCXX_BEGIN_VERSION_NAMESPACE and + _GLIBCXX_END_VERSION_NAMESPACE. + * include/tr1/cfenv: Likewise. + * include/tr1/cinttypes: Likewise. + * include/tr1/cstdint: Likewise. + * include/tr1/cstdio: Likewise. + * include/tr1/cstdlib: Likewise. + * include/tr1/cwchar: Likewise. + * include/tr1/cwctype: Likewise. + * src/c++11/random.cc: Include . (random_devise::_M_init_pretr1): Qualify isdigit call. diff --git a/libstdc++-v3/include/tr1/cctype b/libstdc++-v3/include/tr1/cctype index ce994066188..b35cd04f0db 100644 --- a/libstdc++-v3/include/tr1/cctype +++ b/libstdc++-v3/include/tr1/cctype @@ -38,10 +38,14 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION + namespace tr1 { using ::isblank; } + +_GLIBCXX_END_NAMESPACE_VERSION } #endif diff --git a/libstdc++-v3/include/tr1/cfenv b/libstdc++-v3/include/tr1/cfenv index a058888978f..97de7542f5b 100644 --- a/libstdc++-v3/include/tr1/cfenv +++ b/libstdc++-v3/include/tr1/cfenv @@ -53,6 +53,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION + namespace tr1 { // types @@ -74,6 +76,8 @@ namespace tr1 using ::fesetenv; using ::feupdateenv; } + +_GLIBCXX_END_NAMESPACE_VERSION } #endif // _GLIBCXX_USE_C99_FENV_TR1 diff --git a/libstdc++-v3/include/tr1/cinttypes b/libstdc++-v3/include/tr1/cinttypes index e665e188289..1c08166efdc 100644 --- a/libstdc++-v3/include/tr1/cinttypes +++ b/libstdc++-v3/include/tr1/cinttypes @@ -50,6 +50,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION + namespace tr1 { // types @@ -77,6 +79,8 @@ namespace tr1 using ::wcstoumax; #endif } + +_GLIBCXX_END_NAMESPACE_VERSION } #endif // _GLIBCXX_USE_C99_INTTYPES_TR1 diff --git a/libstdc++-v3/include/tr1/cstdint b/libstdc++-v3/include/tr1/cstdint index 0597d19fb1b..3211a9690f8 100644 --- a/libstdc++-v3/include/tr1/cstdint +++ b/libstdc++-v3/include/tr1/cstdint @@ -58,6 +58,7 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION namespace tr1 { using ::int8_t; @@ -96,6 +97,7 @@ namespace tr1 using ::uintmax_t; using ::uintptr_t; } +_GLIBCXX_END_NAMESPACE_VERSION } #endif // _GLIBCXX_USE_C99_STDINT_TR1 diff --git a/libstdc++-v3/include/tr1/cstdio b/libstdc++-v3/include/tr1/cstdio index 7d72e58b5d4..f8a9182bcaa 100644 --- a/libstdc++-v3/include/tr1/cstdio +++ b/libstdc++-v3/include/tr1/cstdio @@ -37,6 +37,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION + namespace tr1 { using std::snprintf; @@ -46,6 +48,8 @@ namespace tr1 using std::vscanf; using std::vsscanf; } + +_GLIBCXX_END_NAMESPACE_VERSION } #endif diff --git a/libstdc++-v3/include/tr1/cstdlib b/libstdc++-v3/include/tr1/cstdlib index a8259575ba2..0271e884436 100644 --- a/libstdc++-v3/include/tr1/cstdlib +++ b/libstdc++-v3/include/tr1/cstdlib @@ -39,6 +39,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION + namespace tr1 { #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC @@ -63,6 +65,8 @@ namespace tr1 using std::div; #endif } + +_GLIBCXX_END_NAMESPACE_VERSION } #endif // _GLIBCXX_USE_C99_STDLIB diff --git a/libstdc++-v3/include/tr1/cwchar b/libstdc++-v3/include/tr1/cwchar index 0d45ca79933..d2517f665f8 100644 --- a/libstdc++-v3/include/tr1/cwchar +++ b/libstdc++-v3/include/tr1/cwchar @@ -37,6 +37,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION + namespace tr1 { #if _GLIBCXX_HAVE_WCSTOF @@ -58,6 +60,8 @@ namespace tr1 using std::wcstoull; #endif } + +_GLIBCXX_END_NAMESPACE_VERSION } #endif // _GLIBCXX_USE_WCHAR_T diff --git a/libstdc++-v3/include/tr1/cwctype b/libstdc++-v3/include/tr1/cwctype index b5f2c2f07fc..5d343a11c6b 100644 --- a/libstdc++-v3/include/tr1/cwctype +++ b/libstdc++-v3/include/tr1/cwctype @@ -37,12 +37,16 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION + namespace tr1 { #if _GLIBCXX_HAVE_ISWBLANK using std::iswblank; #endif } + +_GLIBCXX_END_NAMESPACE_VERSION } #endif // _GLIBCXX_USE_WCHAR_T -- 2.30.2