Index: boost/thread/detail/config.hpp =================================================================== --- boost/thread/detail/config.hpp (revision 50187) +++ boost/thread/detail/config.hpp (working copy) @@ -45,17 +45,13 @@ # endif #endif -#if defined(BOOST_HAS_DECLSPEC) -# if defined(BOOST_THREAD_BUILD_DLL) //Build dll -# define BOOST_THREAD_DECL __declspec(dllexport) -# elif defined(BOOST_THREAD_USE_DLL) //Use dll -# define BOOST_THREAD_DECL __declspec(dllimport) -# else -# define BOOST_THREAD_DECL -# endif +#if defined(BOOST_THREAD_BUILD_DLL) //Build dll +# define BOOST_THREAD_DECL BOOST_SYMBOL_EXPORT +#elif defined(BOOST_THREAD_USE_DLL) //Use dll +# define BOOST_THREAD_DECL BOOST_SYMBOL_IMPORT #else -# define BOOST_THREAD_DECL -#endif // BOOST_HAS_DECLSPEC +# define BOOST_THREAD_DECL +#endif // // Automatically link to the correct build variant where possible. Index: boost/serialization/config.hpp =================================================================== --- boost/serialization/config.hpp (revision 50187) +++ boost/serialization/config.hpp (working copy) @@ -27,7 +27,6 @@ #undef BOOST_SERIALIZATION_DECL #endif -#ifdef BOOST_HAS_DECLSPEC // defined in config system // we need to import/export our code only if the user has specifically // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost // libraries to be dynamically linked, or BOOST_SERIALIZATION_DYN_LINK @@ -38,20 +37,11 @@ #endif // export if this is our own source, otherwise import: #if defined(BOOST_SERIALIZATION_SOURCE) - #if defined(__BORLANDC__) - #define BOOST_SERIALIZATION_DECL(T) T __export - #else - #define BOOST_SERIALIZATION_DECL(T) __declspec(dllexport) T - #endif + #define BOOST_SERIALIZATION_DECL(T) BOOST_SYMBOL_EXPORT T #else - #if defined(__BORLANDC__) - #define BOOST_SERIALIZATION_DECL(T) T __import - #else - #define BOOST_SERIALIZATION_DECL(T) __declspec(dllimport) T - #endif + #define BOOST_SERIALIZATION_DECL(T) BOOST_SYMBOL_IMPORT T #endif // defined(BOOST_SERIALIZATION_SOURCE) #endif // defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK) -#endif // BOOST_HAS_DECLSPEC // if BOOST_SERIALIZATION_DECL isn't defined yet define it now: #ifndef BOOST_SERIALIZATION_DECL Index: boost/math/tr1.hpp =================================================================== --- boost/math/tr1.hpp (revision 50187) +++ boost/math/tr1.hpp (working copy) @@ -20,7 +20,6 @@ #endif // __cplusplus -#ifdef BOOST_HAS_DECLSPEC // defined in config system // we need to import/export our code only if the user has specifically // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost // libraries to be dynamically linked, or BOOST_MATH_TR1_DYN_LINK @@ -28,12 +27,11 @@ #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_MATH_TR1_DYN_LINK) // export if this is our own source, otherwise import: #ifdef BOOST_MATH_TR1_SOURCE -# define BOOST_MATH_TR1_DECL __declspec(dllexport) +# define BOOST_MATH_TR1_DECL BOOST_SYMBOL_EXPORT #else -# define BOOST_MATH_TR1_DECL __declspec(dllimport) +# define BOOST_MATH_TR1_DECL BOOST_SYMBOL_IMPORT #endif // BOOST_MATH_TR1_SOURCE #endif // DYN_LINK -#endif // BOOST_HAS_DECLSPEC // // if BOOST_MATH_TR1_DECL isn't defined yet define it now: #ifndef BOOST_MATH_TR1_DECL Index: boost/signals/detail/config.hpp =================================================================== --- boost/signals/detail/config.hpp (revision 50187) +++ boost/signals/detail/config.hpp (working copy) @@ -17,15 +17,13 @@ #include -#ifdef BOOST_HAS_DECLSPEC -# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SIGNALS_DYN_LINK) -# ifdef BOOST_SIGNALS_SOURCE -# define BOOST_SIGNALS_DECL __declspec(dllexport) -# else -# define BOOST_SIGNALS_DECL __declspec(dllimport) -# endif // BOOST_SIGNALS_SOURCE -# endif // DYN_LINK -#endif // BOOST_HAS_DECLSPEC +#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SIGNALS_DYN_LINK) +# ifdef BOOST_SIGNALS_SOURCE +# define BOOST_SIGNALS_DECL BOOST_SYMBOL_EXPORT +# else +# define BOOST_SIGNALS_DECL BOOST_SYMBOL_IMPORT +# endif // BOOST_SIGNALS_SOURCE +#endif // DYN_LINK #ifndef BOOST_SIGNALS_DECL # define BOOST_SIGNALS_DECL Index: boost/wave/wave_config.hpp =================================================================== --- boost/wave/wave_config.hpp (revision 50187) +++ boost/wave/wave_config.hpp (working copy) @@ -402,15 +402,14 @@ /////////////////////////////////////////////////////////////////////////////// // Set up dll import/export options -#if defined(BOOST_HAS_DECLSPEC) && \ - (defined(BOOST_WAVE_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && \ +#if (defined(BOOST_WAVE_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && \ !defined(BOOST_WAVE_STATIC_LINK) #if defined(BOOST_WAVE_SOURCE) -#define BOOST_WAVE_DECL __declspec(dllexport) +#define BOOST_WAVE_DECL BOOST_SYMBOL_EXPORT #define BOOST_WAVE_BUILD_DLL #else -#define BOOST_WAVE_DECL __declspec(dllimport) +#define BOOST_WAVE_DECL BOOST_SYMBOL_IMPORT #endif #endif // building a shared library Index: boost/regex/config.hpp =================================================================== --- boost/regex/config.hpp (revision 50187) +++ boost/regex/config.hpp (working copy) @@ -180,12 +180,12 @@ * ****************************************************************************/ -#if defined(BOOST_HAS_DECLSPEC) && (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK) +#if defined BOOST_SYMBOL_EXPORT && (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK) # if defined(BOOST_REGEX_SOURCE) -# define BOOST_REGEX_DECL __declspec(dllexport) +# define BOOST_REGEX_DECL BOOST_SYMBOL_EXPORT # define BOOST_REGEX_BUILD_DLL # else -# define BOOST_REGEX_DECL __declspec(dllimport) +# define BOOST_REGEX_DECL BOOST_SYMBOL_IMPORT # endif #endif Index: boost/filesystem/config.hpp =================================================================== --- boost/filesystem/config.hpp (revision 50187) +++ boost/filesystem/config.hpp (working copy) @@ -70,7 +70,6 @@ # error Dynamic linking Boost.Filesystem does not work for Borland; use static linking instead # endif -#ifdef BOOST_HAS_DECLSPEC // defined in config system // we need to import/export our code only if the user has specifically // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost // libraries to be dynamically linked, or BOOST_FILESYSTEM_DYN_LINK @@ -78,12 +77,11 @@ #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK) // export if this is our own source, otherwise import: #ifdef BOOST_FILESYSTEM_SOURCE -# define BOOST_FILESYSTEM_DECL __declspec(dllexport) +# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT #else -# define BOOST_FILESYSTEM_DECL __declspec(dllimport) +# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT #endif // BOOST_FILESYSTEM_SOURCE #endif // DYN_LINK -#endif // BOOST_HAS_DECLSPEC // // if BOOST_FILESYSTEM_DECL isn't defined yet define it now: #ifndef BOOST_FILESYSTEM_DECL Index: boost/config.hpp =================================================================== --- boost/config.hpp (revision 50187) +++ boost/config.hpp (working copy) @@ -56,6 +56,9 @@ // get config suffix code: #include +//shared libraries symbols export/import +#include + #endif // BOOST_CONFIG_HPP Index: boost/iostreams/detail/config/dyn_link.hpp =================================================================== --- boost/iostreams/detail/config/dyn_link.hpp (revision 50187) +++ boost/iostreams/detail/config/dyn_link.hpp (working copy) @@ -20,15 +20,13 @@ //------------------Enable dynamic linking on windows-------------------------// -#ifdef BOOST_HAS_DECLSPEC -# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_IOSTREAMS_DYN_LINK) -# ifdef BOOST_IOSTREAMS_SOURCE -# define BOOST_IOSTREAMS_DECL __declspec(dllexport) -# else -# define BOOST_IOSTREAMS_DECL __declspec(dllimport) -# endif +#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_IOSTREAMS_DYN_LINK) +# ifdef BOOST_IOSTREAMS_SOURCE +# define BOOST_IOSTREAMS_DECL BOOST_SYMBOL_EXPORT +# else +# define BOOST_IOSTREAMS_DECL BOOST_SYMBOL_IMPORT # endif -#endif +#endif #ifndef BOOST_IOSTREAMS_DECL # define BOOST_IOSTREAMS_DECL Index: boost/python/detail/config.hpp =================================================================== --- boost/python/detail/config.hpp (revision 50187) +++ boost/python/detail/config.hpp (working copy) @@ -74,23 +74,16 @@ # define BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY 1 # endif -# if BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY -# if defined(BOOST_PYTHON_SOURCE) -# define BOOST_PYTHON_DECL __attribute__ ((visibility("default"))) -# define BOOST_PYTHON_BUILD_DLL -# else -# define BOOST_PYTHON_DECL -# endif -# define BOOST_PYTHON_DECL_FORWARD -# define BOOST_PYTHON_DECL_EXCEPTION __attribute__ ((visibility("default"))) -# elif (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 -# endif +# if defined(BOOST_PYTHON_SOURCE) +# define BOOST_PYTHON_BUILD_DLL +# define BOOST_PYTHON_DECL BOOST_SYMBOL_EXPORT +# define BOOST_PYTHON_DECL_EXCEPTION BOOST_EXCEPTION_EXPORT +# define BOOST_PYTHON_DECL_FORWARD BOOST_SYMBOL_FORWARD_EXPORT +# else +# define BOOST_PYTHON_DECL BOOST_SYMBOL_IMPORT +# define BOOST_PYTHON_DECL_EXCEPTION BOOST_EXCEPTION_IMPORT +# define BOOST_PYTHON_DECL_FORWARD BOOST_SYMBOL_FORWARD_IMPORT +#endif #endif Index: boost/mpi/config.hpp =================================================================== --- boost/mpi/config.hpp (revision 50187) +++ boost/mpi/config.hpp (working copy) @@ -80,12 +80,12 @@ * * *****************************************************************************/ -#if defined(BOOST_HAS_DECLSPEC) && (defined(BOOST_MPI_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_MPI_STATIC_LINK) +#if (defined(BOOST_MPI_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_MPI_STATIC_LINK) # if defined(BOOST_MPI_SOURCE) -# define BOOST_MPI_DECL __declspec(dllexport) +# define BOOST_MPI_DECL BOOST_SYMBOL_EXPORT # define BOOST_MPI_BUILD_DLL # else -# define BOOST_MPI_DECL __declspec(dllimport) +# define BOOST_MPI_DECL BOOST_SYMBOL_IMPORT # endif #endif Index: boost/date_time/compiler_config.hpp =================================================================== --- boost/date_time/compiler_config.hpp (revision 50187) +++ boost/date_time/compiler_config.hpp (working copy) @@ -118,20 +118,18 @@ * */ -#ifdef BOOST_HAS_DECLSPEC // defined in config system - // we need to import/export our code only if the user has specifically - // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost - // libraries to be dynamically linked, or BOOST_DATE_TIME_DYN_LINK - // if they want just this one to be dynamically liked: -# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK) - // export if this is our own source, otherwise import: -# ifdef BOOST_DATE_TIME_SOURCE -# define BOOST_DATE_TIME_DECL __declspec(dllexport) -# else -# define BOOST_DATE_TIME_DECL __declspec(dllimport) -# endif // BOOST_DATE_TIME_SOURCE -# endif // DYN_LINK -#endif // BOOST_HAS_DECLSPEC +// we need to import/export our code only if the user has specifically +// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost +// libraries to be dynamically linked, or BOOST_DATE_TIME_DYN_LINK +// if they want just this one to be dynamically liked: +#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK) + // export if this is our own source, otherwise import: +# ifdef BOOST_DATE_TIME_SOURCE +# define BOOST_DATE_TIME_DECL BOOST_SYMBOL_EXPORT +# else +# define BOOST_DATE_TIME_DECL BOOST_SYMBOL_IMPORT +# endif // BOOST_DATE_TIME_SOURCE +#endif // DYN_LINK // // if BOOST_WHATEVER_DECL isn't defined yet define it now: #ifndef BOOST_DATE_TIME_DECL Index: boost/graph/graphviz.hpp =================================================================== --- boost/graph/graphviz.hpp (revision 50187) +++ boost/graph/graphviz.hpp (working copy) @@ -24,15 +24,13 @@ #include #include -#ifdef BOOST_HAS_DECLSPEC -# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_GRAPH_DYN_LINK) -# ifdef BOOST_GRAPH_SOURCE -# define BOOST_GRAPH_DECL __declspec(dllexport) -# else -# define BOOST_GRAPH_DECL __declspec(dllimport) -# endif // BOOST_GRAPH_SOURCE -# endif // DYN_LINK -#endif // BOOST_HAS_DECLSPEC +#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_GRAPH_DYN_LINK) +# ifdef BOOST_GRAPH_SOURCE +# define BOOST_GRAPH_DECL BOOST_SYMBOL_EXPORT +# else +# define BOOST_GRAPH_DECL BOOST_SYMBOL_IMPORT +# endif // BOOST_GRAPH_SOURCE +#endif // DYN_LINK #ifndef BOOST_GRAPH_DECL # define BOOST_GRAPH_DECL Index: boost/program_options/config.hpp =================================================================== --- boost/program_options/config.hpp (revision 50187) +++ boost/program_options/config.hpp (working copy) @@ -33,18 +33,15 @@ #endif // BOOST_VERSION -/////////////////////////////////////////////////////////////////////////////// -// Windows DLL suport -#ifdef BOOST_HAS_DECLSPEC + #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_PROGRAM_OPTIONS_DYN_LINK) // export if this is our own source, otherwise import: #ifdef BOOST_PROGRAM_OPTIONS_SOURCE -# define BOOST_PROGRAM_OPTIONS_DECL __declspec(dllexport) +# define BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_EXPORT #else -# define BOOST_PROGRAM_OPTIONS_DECL __declspec(dllimport) +# define BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_IMPORT #endif // BOOST_PROGRAM_OPTIONS_SOURCE #endif // DYN_LINK -#endif // BOOST_HAS_DECLSPEC #ifndef BOOST_PROGRAM_OPTIONS_DECL #define BOOST_PROGRAM_OPTIONS_DECL Index: boost/config/dso.hpp =================================================================== --- boost/config/dso.hpp (revision 0) +++ boost/config/dso.hpp (revision 0) @@ -0,0 +1,44 @@ +#if !defined BOOST_CONFIG_DYNAMIC_SHARED_OBJECT_SYMBOL_EXPORT_IMPORT_HPP +#define BOOST_CONFIG_DYNAMIC_SHARED_OBJECT_SYMBOL_EXPORT_IMPORT_HPP + +//note: for gcc -fvisibility=hidden or -fvisibility=ms-compat flags +//should be passed to compiler + +#if defined __GNUC__ && __GNUC__ >= 4 + +# define BOOST_SYMBOL_EXPORT __attribute__((visibility("default"))) +# define BOOST_SYMBOL_HIDE __attribute__((visibility("hidden"))) +# define BOOST_SYMBOL_IMPORT +# define BOOST_SYMBOL_FORWARD_EXPORT +# define BOOST_SYMBOL_FORWARD_IMPORT +# define BOOST_EXCEPTION_EXPORT BOOST_SYMBOL_EXPORT +# define BOOST_EXCEPTION_IMPORT BOOST_SYMBOL_EXPORT + +#elif defined _MSC_VER || defined __BORLANDC__ + +# define BOOST_SYMBOL_EXPORT __declspec(dllexport) +# define BOOST_SYMBOL_HIDE +# define BOOST_SYMBOL_IMPORT __declspec(dllimport) +# define BOOST_SYMBOL_FORWARD_EXPORT BOOST_SYMBOL_EXPORT +# define BOOST_SYMBOL_FORWARD_IMPORT BOOST_SYMBOL_IMPORT +# define BOOST_EXCEPTION_EXPORT BOOST_SYMBOL_EXPORT +# define BOOST_EXCEPTION_IMPORT BOOST_SYMBOL_IMPORT + +#endif + + +#if !defined BOOST_SYMBOL_EXPORT +# define BOOST_SYMBOL_EXPORT +# define BOOST_SYMBOL_HIDE +# define BOOST_SYMBOL_IMPORT +# define BOOST_SYMBOL_FORWARD_EXPORT +# define BOOST_SYMBOL_FORWARD_IMPORT +# define BOOST_EXCEPTION_EXPORT +# define BOOST_EXCEPTION_IMPORT +# define BOOST_SYMBOL_FORWARD_EXPORT +# define BOOST_SYMBOL_FORWARD_IMPORT +#endif + + +#endif + Index: boost/system/config.hpp =================================================================== --- boost/system/config.hpp (revision 50187) +++ boost/system/config.hpp (working copy) @@ -31,7 +31,6 @@ //# error Dynamic linking Boost.System does not work for Borland; use static linking instead //# endif -#ifdef BOOST_HAS_DECLSPEC // defined in config system // we need to import/export our code only if the user has specifically // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost // libraries to be dynamically linked, or BOOST_SYSTEM_DYN_LINK @@ -39,12 +38,11 @@ #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SYSTEM_DYN_LINK) // export if this is our own source, otherwise import: #ifdef BOOST_SYSTEM_SOURCE -# define BOOST_SYSTEM_DECL __declspec(dllexport) +# define BOOST_SYSTEM_DECL BOOST_SYMBOL_EXPORT #else -# define BOOST_SYSTEM_DECL __declspec(dllimport) +# define BOOST_SYSTEM_DECL BOOST_SYMBOL_IMPORT #endif // BOOST_SYSTEM_SOURCE #endif // DYN_LINK -#endif // BOOST_HAS_DECLSPEC // // if BOOST_SYSTEM_DECL isn't defined yet define it now: #ifndef BOOST_SYSTEM_DECL