mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +00:00
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:
parent
c4e180081d
commit
39498b2bd3
@ -62,7 +62,7 @@ struct type_info {
|
|||||||
bool module_local : 1;
|
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;
|
static internals *internals_ptr = nullptr;
|
||||||
return internals_ptr;
|
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:
|
// Works like internals.registered_types_cpp, but for module-local registered types:
|
||||||
PYBIND11_NOINLINE PYBIND11_UNSHARED_STATIC_LOCALS inline type_map<void *> ®istered_local_types_cpp() {
|
PYBIND11_NOINLINE inline type_map<void *> ®istered_local_types_cpp() {
|
||||||
static type_map<void *> locals{};
|
static type_map<void *> locals{};
|
||||||
return locals;
|
return locals;
|
||||||
}
|
}
|
||||||
|
@ -79,16 +79,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#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)
|
#if defined(_MSC_VER)
|
||||||
# define PYBIND11_NOINLINE __declspec(noinline)
|
# define PYBIND11_NOINLINE __declspec(noinline)
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user