Skip to content

Commit f8055b5

Browse files
authored
Merge pull request #373 from JohanMabille/visibility
Forces visibility of pybind symbols
2 parents 7ab90d6 + 38d8329 commit f8055b5

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

include/xeus-python/xeus_python_config.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,9 @@
3636
#define XEUS_PYTHON_API
3737
#endif
3838

39+
#ifdef _MSC_VER
40+
#define XPYT_FORCE_PYBIND11_EXPORT
41+
#else
42+
#define XPYT_FORCE_PYBIND11_EXPORT __attribute__ ((visibility ("default")))
43+
#endif
3944
#endif

include/xeus-python/xtraceback.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ namespace xpyt
3030
};
3131

3232
XEUS_PYTHON_API void register_filename_mapping(const std::string& filename, int execution_count);
33-
XEUS_PYTHON_API xerror extract_error(py::error_already_set& error);
33+
34+
XEUS_PYTHON_API XPYT_FORCE_PYBIND11_EXPORT
35+
xerror extract_error(py::error_already_set& error);
3436
}
3537

3638
#endif

include/xeus-python/xutils.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ namespace nl = nlohmann;
2828

2929
namespace xpyt
3030
{
31-
XEUS_PYTHON_API bool is_pyobject_true(const py::object& obj);
31+
XEUS_PYTHON_API XPYT_FORCE_PYBIND11_EXPORT
32+
bool is_pyobject_true(const py::object& obj);
3233

3334
XEUS_PYTHON_API bool holding_gil();
3435

@@ -43,8 +44,11 @@ namespace xpyt
4344
func; \
4445
}
4546

46-
XEUS_PYTHON_API void exec(const py::object& code, const py::object& scope = py::globals());
47-
XEUS_PYTHON_API py::object eval(const py::object& code, const py::object& scope = py::globals());
47+
XEUS_PYTHON_API XPYT_FORCE_PYBIND11_EXPORT
48+
void exec(const py::object& code, const py::object& scope = py::globals());
49+
50+
XEUS_PYTHON_API XPYT_FORCE_PYBIND11_EXPORT
51+
py::object eval(const py::object& code, const py::object& scope = py::globals());
4852
}
4953

5054
#endif

0 commit comments

Comments
 (0)