diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-03-07 15:07:05 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-03-07 15:10:29 +0000 |
commit | 4cb935cb69f12088975fa7f6907c6ace0580e2dd (patch) | |
tree | 6612629cf094074ee3e702d05a750c571b3f1cb9 | |
parent | 111754595cf8d3a8ae7063a42ac4cea18a304711 (diff) | |
download | gcc-4cb935cb69f12088975fa7f6907c6ace0580e2dd.zip gcc-4cb935cb69f12088975fa7f6907c6ace0580e2dd.tar.gz gcc-4cb935cb69f12088975fa7f6907c6ace0580e2dd.tar.bz2 |
libstdc++: Use visibility pragmas instead of attributes [PR104807]
The _GLIBCXX_PSEUDO_VISIBILITY macro isn't defined until after including
os_defines.h, so we can't use _GLIBCXX_VISIBILITY early in c++config.
Replace the uses of that macro with #pragma visibility push(default)
instead.
libstdc++-v3/ChangeLog:
PR libstdc++/104807
* include/bits/c++config (__terminate, __glibcxx_assert_fail):
Replace _GLIBCXX_VISIBILITY on function with visibility pragma.
(__is_constant_evaluated): Add visibility pragma.
-rw-r--r-- | libstdc++-v3/include/bits/c++config | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 6c134f1..2798b97 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -302,15 +302,16 @@ namespace std typedef decltype(nullptr) nullptr_t; #endif +#pragma GCC visibility push(default) // This allows the library to terminate without including all of <exception> // and without making the declaration of std::terminate visible to users. extern "C++" __attribute__ ((__noreturn__, __always_inline__)) - _GLIBCXX_VISIBILITY(default) inline void __terminate() _GLIBCXX_USE_NOEXCEPT { void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__)); terminate(); } +#pragma GCC visibility pop } #define _GLIBCXX_USE_DUAL_ABI @@ -506,6 +507,7 @@ namespace std namespace std { +#pragma GCC visibility push(default) // Internal version of std::is_constant_evaluated(). // This can be used without checking if the compiler supports the feature. // The macro _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED can be used to check if @@ -523,6 +525,7 @@ namespace std return false; #endif } +#pragma GCC visibility pop } // Debug Mode implies checking assertions. @@ -553,13 +556,15 @@ namespace std # ifdef _GLIBCXX_VERBOSE_ASSERT namespace std { +#pragma GCC visibility push(default) // Avoid the use of assert, because we're trying to keep the <cassert> // include out of the mix. - extern "C++" _GLIBCXX_NORETURN _GLIBCXX_VISIBILITY(default) + extern "C++" _GLIBCXX_NORETURN void __glibcxx_assert_fail(const char* __file, int __line, const char* __function, const char* __condition) _GLIBCXX_NOEXCEPT; +#pragma GCC visibility pop } #define __glibcxx_assert_impl(_Condition) \ if (__builtin_expect(!bool(_Condition), false)) \ |