File tree Expand file tree Collapse file tree 3 files changed +31
-6
lines changed
Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Original file line number Diff line number Diff line change 7171# define BOOST_PYTHON_NO_TEMPLATE_EXPORT
7272#endif
7373
74- #if defined(BOOST_PYTHON_DYNAMIC_LIB) && (defined(_WIN32) || defined(__CYGWIN__))
75- # if defined(BOOST_PYTHON_SOURCE)
76- # define BOOST_PYTHON_DECL __declspec (dllexport)
77- # define BOOST_PYTHON_BUILD_DLL
78- # else
79- # define BOOST_PYTHON_DECL __declspec (dllimport)
74+ #if defined(BOOST_PYTHON_DYNAMIC_LIB)
75+ # if (defined(_WIN32) || defined(__CYGWIN__))
76+ # if defined(BOOST_PYTHON_SOURCE)
77+ # define BOOST_PYTHON_DECL __declspec (dllexport)
78+ # define BOOST_PYTHON_BUILD_DLL
79+ # else
80+ # define BOOST_PYTHON_DECL __declspec (dllimport)
81+ # endif
82+ # elif (defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >=5)
83+ # if defined(BOOST_PYTHON_SOURCE)
84+ # define BOOST_PYTHON_DECL __attribute__ ((visibility(" default" )))
85+ # define BOOST_PYTHON_BUILD_DLL
86+ # define BOOST_PYTHON_NODECL_DECLARATIONS
87+ # else
88+ # define BOOST_PYTHON_DECL
89+ # endif
8090# endif
8191
8292// MinGW, at least, has some problems exporting template instantiations
Original file line number Diff line number Diff line change @@ -42,6 +42,16 @@ extern "C" \
4242} \
4343void init_module_##name()
4444
45+ # elif (defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >=5)
46+
47+ # define BOOST_PYTHON_MODULE_INIT (name ) \
48+ void init_module_##name(); \
49+ extern " C" __attribute__ ((visibility(" default" ))) void init##name() \
50+ { \
51+ boost::python::detail::init_module (#name, &init_module_##name); \
52+ } \
53+ void init_module_##name()
54+
4555# else
4656
4757# define BOOST_PYTHON_MODULE_INIT (name ) \
Original file line number Diff line number Diff line change 1111
1212namespace boost { namespace python
1313{
14+ #ifdef BOOST_PYTHON_NODECL_DECLARATIONS
15+ // Only declaring with BOOST_PYTHON_DECL makes no sense on GCC
16+ struct instance_holder ;
17+ #else
1418 struct BOOST_PYTHON_DECL instance_holder;
19+ #endif
1520}} // namespace boost::python
1621
1722namespace boost { namespace python { namespace objects {
You can’t perform that action at this time.
0 commit comments