2
0
mirror of https://github.com/boostorg/python.git synced 2026-02-01 20:52:13 +00:00

Apply GCC export limiting patch from Niall Douglas s_sourceforge-at-nedprod.com

[SVN r25271]
This commit is contained in:
Dave Abrahams
2004-09-20 12:47:31 +00:00
parent 3ba268ed9c
commit 0b026dc5a2
3 changed files with 31 additions and 6 deletions

View File

@@ -71,12 +71,22 @@
# define BOOST_PYTHON_NO_TEMPLATE_EXPORT
#endif
#if defined(BOOST_PYTHON_DYNAMIC_LIB) && (defined(_WIN32) || defined(__CYGWIN__))
# if defined(BOOST_PYTHON_SOURCE)
# define BOOST_PYTHON_DECL __declspec(dllexport)
# define BOOST_PYTHON_BUILD_DLL
# else
# define BOOST_PYTHON_DECL __declspec(dllimport)
#if defined(BOOST_PYTHON_DYNAMIC_LIB)
# if (defined(_WIN32) || defined(__CYGWIN__))
# if defined(BOOST_PYTHON_SOURCE)
# define BOOST_PYTHON_DECL __declspec(dllexport)
# define BOOST_PYTHON_BUILD_DLL
# else
# define BOOST_PYTHON_DECL __declspec(dllimport)
# endif
# elif (defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >=5)
# if defined(BOOST_PYTHON_SOURCE)
# define BOOST_PYTHON_DECL __attribute__ ((visibility("default")))
# define BOOST_PYTHON_BUILD_DLL
# define BOOST_PYTHON_NODECL_DECLARATIONS
# else
# define BOOST_PYTHON_DECL
# endif
# endif
// MinGW, at least, has some problems exporting template instantiations

View File

@@ -42,6 +42,16 @@ extern "C" \
} \
void init_module_##name()
# elif (defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >=5)
# define BOOST_PYTHON_MODULE_INIT(name) \
void init_module_##name(); \
extern "C" __attribute__ ((visibility("default"))) void init##name() \
{ \
boost::python::detail::init_module(#name, &init_module_##name); \
} \
void init_module_##name()
# else
# define BOOST_PYTHON_MODULE_INIT(name) \

View File

@@ -11,7 +11,12 @@
namespace boost { namespace python
{
#ifdef BOOST_PYTHON_NODECL_DECLARATIONS
// Only declaring with BOOST_PYTHON_DECL makes no sense on GCC
struct instance_holder;
#else
struct BOOST_PYTHON_DECL instance_holder;
#endif
}} // namespace boost::python
namespace boost { namespace python { namespace objects {