Commit 39498b2b by Jason Rhinelander

Remove PYBIND11_UNSHARED_STATIC_LOCALS macro

The macro isn't doing anything useful now that hidden visibility is
applied to all pybind11 code.
parent c4e18008
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment