Force hidden visibility on pybind code

This adds a PYBIND11_NAMESPACE macro that expands to the `pybind11`
namespace with hidden visibility under gcc-type compilers, and otherwise
to the plain `pybind11`.  This then forces hidden visibility on
everything in pybind, solving the visibility issues discussed at end
end of #949.
This commit is contained in:
Jason Rhinelander
2017-08-10 12:03:29 -04:00
parent 8d3cedbe2b
commit a859dd67a2
20 changed files with 51 additions and 40 deletions

View File

@@ -17,7 +17,7 @@
# undef I
#endif
NAMESPACE_BEGIN(pybind11)
NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
template <typename T> struct format_descriptor<std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>> {
static constexpr const char c = format_descriptor<T>::c;
@@ -58,4 +58,4 @@ public:
PYBIND11_TYPE_CASTER(std::complex<T>, _("complex"));
};
NAMESPACE_END(detail)
NAMESPACE_END(pybind11)
NAMESPACE_END(PYBIND11_NAMESPACE)