Remove PYBIND11_UNSHARED_STATIC_LOCALS macro

The macro isn't doing anything useful now that hidden visibility is
applied to all pybind11 code.
This commit is contained in:
Jason Rhinelander 2017-08-17 11:34:43 -04:00
parent c4e180081d
commit 39498b2bd3
2 changed files with 2 additions and 12 deletions

View File

@ -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<void *> &registered_local_types_cpp() {
PYBIND11_NOINLINE inline type_map<void *> &registered_local_types_cpp() {
static type_map<void *> locals{};
return locals;
}

View File

@ -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