From ed9bc835a267ff3fc5116708bb50c71d38868f3b Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 28 Dec 2001 23:56:10 +0000 Subject: [PATCH] Stuck the extension_class code in the DLL whenever possible Removed some flotsam [SVN r12166] --- include/boost/python/detail/config.hpp | 44 ++++++++++++++++++++------ 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/include/boost/python/detail/config.hpp b/include/boost/python/detail/config.hpp index c79eb2ca..97d84a79 100644 --- a/include/boost/python/detail/config.hpp +++ b/include/boost/python/detail/config.hpp @@ -76,19 +76,29 @@ # define BOOST_PYTHON_STATIC_LINK #endif -#if defined(BOOST_MSVC) && defined(_DLL) && !defined(BOOST_PYTHON_HAS_DLL_RUNTIME) -# define BOOST_PYTHON_HAS_DLL_RUNTIME +#if defined(__MWERKS__) +# define BOOST_PYTHON_NO_TEMPLATE_EXPORT #endif -#if defined(__BORLANDC__) && defined(_RTLDLL) && !defined(BOOST_PYTHON_HAS_DLL_RUNTIME) -# define BOOST_PYTHON_HAS_DLL_RUNTIME +#if defined(__GNUC__) +# define BOOST_PYTHON_IMPORT_TEMPLATE_KEYWORD extern +# define BOOST_PYTHON_EXPORT_TEMPLATE_KEYWORD extern #endif -#if defined(__ICL) && defined(_DLL) && !defined(BOOST_PYTHON_HAS_DLL_RUNTIME) -# define BOOST_PYTHON_HAS_DLL_RUNTIME +// Handle default cases +#ifndef BOOST_PYTHON_IMPORT_TEMPLATE_KEYWORD +# ifdef _WIN32 +# define BOOST_PYTHON_IMPORT_TEMPLATE_KEYWORD extern +# else +# define BOOST_PYTHON_IMPORT_TEMPLATE_KEYWORD +# endif #endif -#if defined(BOOST_PYTHON_DYNAMIC_LIB) && defined(_WIN32) // && !defined(BOOST_PYTHON_STATIC_LINK) +#ifndef BOOST_PYTHON_EXPORT_TEMPLATE_KEYWORD +# define BOOST_PYTHON_EXPORT_TEMPLATE_KEYWORD +#endif + +#if defined(BOOST_PYTHON_DYNAMIC_LIB) && defined(_WIN32) # if defined(BOOST_PYTHON_SOURCE) # define BOOST_PYTHON_DECL __declspec(dllexport) # define BOOST_PYTHON_BUILD_DLL @@ -101,10 +111,26 @@ # define BOOST_PYTHON_DECL #endif -#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_PYTHON_NO_LIB) && !defined(BOOST_PYTHON_SOURCE) -// # include +#ifndef BOOST_PYTHON_DECL_TEMPLATE +# ifndef BOOST_PYTHON_NO_TEMPLATE_EXPORT +# define BOOST_PYTHON_DECL_TEMPLATE BOOST_PYTHON_DECL +# else +# define BOOST_PYTHON_DECL_TEMPLATE +# endif #endif +#if defined(BOOST_PYTHON_SOURCE) +# define BOOST_PYTHON_EXPORT BOOST_PYTHON_EXPORT_TEMPLATE_KEYWORD +#else +# define BOOST_PYTHON_EXPORT BOOST_PYTHON_IMPORT_TEMPLATE_KEYWORD +#endif + +# ifndef BOOST_PYTHON_EXPORT_TEMPLATE +# define BOOST_PYTHON_EXPORT_TEMPLATE BOOST_PYTHON_EXPORT template +# endif + +# define BOOST_PYTHON_EXPORT_TEMPLATE_CLASS BOOST_PYTHON_EXPORT template class BOOST_PYTHON_DECL + // Borland C++ Fix/error check: #if defined(__BORLANDC__) # if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551)