diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 415079d62..a0bc8d338 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -62,7 +62,7 @@ struct type_info { bool module_local : 1; }; -PYBIND11_UNSHARED_STATIC_LOCALS PYBIND11_NOINLINE inline internals *&get_internals_ptr() { +PYBIND11_NOINLINE inline internals *&get_internals_ptr() { static internals *internals_ptr = nullptr; return internals_ptr; } @@ -129,7 +129,7 @@ PYBIND11_NOINLINE inline internals &get_internals() { } // Works like internals.registered_types_cpp, but for module-local registered types: -PYBIND11_NOINLINE PYBIND11_UNSHARED_STATIC_LOCALS inline type_map ®istered_local_types_cpp() { +PYBIND11_NOINLINE inline type_map ®istered_local_types_cpp() { static type_map locals{}; return locals; } diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 100873f0b..c831ae3cc 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -79,16 +79,6 @@ # endif #endif -// Attribute macro for a function containing one or more static local variables that mustn't share -// the variable across shared objects (for example, because the value might be incompatible for -// modules compiled under different pybind versions). This is required under g++ (depending on the -// specific compiler and linker options), and won't hurt under gcc-compatible compilers: -#if defined(__GNUG__) -# define PYBIND11_UNSHARED_STATIC_LOCALS __attribute__ ((visibility("hidden"))) -#else -# define PYBIND11_UNSHARED_STATIC_LOCALS -#endif - #if defined(_MSC_VER) # define PYBIND11_NOINLINE __declspec(noinline) #else