Ticket #2114: boost_symbol_export.patch

File boost_symbol_export.patch, 16.9 KB (added by anonymous, 14 years ago)

patch updated: boost part

  • boost/thread/detail/config.hpp

     
    4545#   endif
    4646#endif
    4747
    48 #if defined(BOOST_HAS_DECLSPEC)
    49 #   if defined(BOOST_THREAD_BUILD_DLL) //Build dll
    50 #       define BOOST_THREAD_DECL __declspec(dllexport)
    51 #   elif defined(BOOST_THREAD_USE_DLL) //Use dll
    52 #       define BOOST_THREAD_DECL __declspec(dllimport)
    53 #   else
    54 #       define BOOST_THREAD_DECL
    55 #   endif
     48#if defined(BOOST_THREAD_BUILD_DLL) //Build dll
     49#    define BOOST_THREAD_DECL BOOST_SYMBOL_EXPORT
     50#elif defined(BOOST_THREAD_USE_DLL) //Use dll
     51#    define BOOST_THREAD_DECL BOOST_SYMBOL_IMPORT
    5652#else
    57 #   define BOOST_THREAD_DECL
    58 #endif // BOOST_HAS_DECLSPEC
     53#    define BOOST_THREAD_DECL
     54#endif
    5955
    6056//
    6157// Automatically link to the correct build variant where possible.
  • boost/serialization/config.hpp

     
    2727    #undef BOOST_SERIALIZATION_DECL
    2828#endif
    2929
    30 #ifdef BOOST_HAS_DECLSPEC // defined in config system
    3130// we need to import/export our code only if the user has specifically
    3231// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
    3332// libraries to be dynamically linked, or BOOST_SERIALIZATION_DYN_LINK
     
    3837    #endif
    3938    // export if this is our own source, otherwise import:
    4039    #if defined(BOOST_SERIALIZATION_SOURCE)
    41         #if defined(__BORLANDC__)
    42             #define BOOST_SERIALIZATION_DECL(T) T __export
    43         #else
    44             #define BOOST_SERIALIZATION_DECL(T) __declspec(dllexport) T
    45         #endif
     40        #define BOOST_SERIALIZATION_DECL(T) BOOST_SYMBOL_EXPORT T
    4641    #else
    47         #if defined(__BORLANDC__)
    48             #define BOOST_SERIALIZATION_DECL(T) T __import
    49         #else
    50             #define BOOST_SERIALIZATION_DECL(T) __declspec(dllimport) T
    51         #endif
     42        #define BOOST_SERIALIZATION_DECL(T) BOOST_SYMBOL_IMPORT T
    5243    #endif // defined(BOOST_SERIALIZATION_SOURCE)
    5344#endif // defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)
    54 #endif // BOOST_HAS_DECLSPEC
    5545
    5646// if BOOST_SERIALIZATION_DECL isn't defined yet define it now:
    5747#ifndef BOOST_SERIALIZATION_DECL
  • boost/math/tr1.hpp

     
    2020
    2121#endif // __cplusplus
    2222
    23 #ifdef BOOST_HAS_DECLSPEC // defined in config system
    2423// we need to import/export our code only if the user has specifically
    2524// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
    2625// libraries to be dynamically linked, or BOOST_MATH_TR1_DYN_LINK
     
    2827#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_MATH_TR1_DYN_LINK)
    2928// export if this is our own source, otherwise import:
    3029#ifdef BOOST_MATH_TR1_SOURCE
    31 # define BOOST_MATH_TR1_DECL __declspec(dllexport)
     30# define BOOST_MATH_TR1_DECL BOOST_SYMBOL_EXPORT
    3231#else
    33 # define BOOST_MATH_TR1_DECL __declspec(dllimport)
     32# define BOOST_MATH_TR1_DECL BOOST_SYMBOL_IMPORT
    3433#endif  // BOOST_MATH_TR1_SOURCE
    3534#endif  // DYN_LINK
    36 #endif  // BOOST_HAS_DECLSPEC
    3735//
    3836// if BOOST_MATH_TR1_DECL isn't defined yet define it now:
    3937#ifndef BOOST_MATH_TR1_DECL
  • boost/signals/detail/config.hpp

     
    1717
    1818#include <boost/config.hpp>
    1919
    20 #ifdef BOOST_HAS_DECLSPEC
    21 #  if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SIGNALS_DYN_LINK)
    22 #    ifdef BOOST_SIGNALS_SOURCE
    23 #      define BOOST_SIGNALS_DECL __declspec(dllexport)
    24 #    else
    25 #      define BOOST_SIGNALS_DECL __declspec(dllimport)
    26 #    endif  // BOOST_SIGNALS_SOURCE
    27 #  endif  // DYN_LINK
    28 #endif  // BOOST_HAS_DECLSPEC
     20#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SIGNALS_DYN_LINK)
     21#  ifdef BOOST_SIGNALS_SOURCE
     22#    define BOOST_SIGNALS_DECL BOOST_SYMBOL_EXPORT
     23#  else
     24#    define BOOST_SIGNALS_DECL BOOST_SYMBOL_IMPORT
     25#  endif  // BOOST_SIGNALS_SOURCE
     26#endif  // DYN_LINK
    2927
    3028#ifndef BOOST_SIGNALS_DECL
    3129#  define BOOST_SIGNALS_DECL
  • boost/wave/wave_config.hpp

     
    402402
    403403///////////////////////////////////////////////////////////////////////////////
    404404//  Set up dll import/export options
    405 #if defined(BOOST_HAS_DECLSPEC) && \
    406     (defined(BOOST_WAVE_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && \
     405#if (defined(BOOST_WAVE_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && \
    407406    !defined(BOOST_WAVE_STATIC_LINK)
    408407   
    409408#if defined(BOOST_WAVE_SOURCE)
    410 #define BOOST_WAVE_DECL __declspec(dllexport)
     409#define BOOST_WAVE_DECL BOOST_SYMBOL_EXPORT
    411410#define BOOST_WAVE_BUILD_DLL
    412411#else
    413 #define BOOST_WAVE_DECL __declspec(dllimport)
     412#define BOOST_WAVE_DECL BOOST_SYMBOL_IMPORT
    414413#endif
    415414
    416415#endif // building a shared library
  • boost/regex/config.hpp

     
    180180 *
    181181 ****************************************************************************/
    182182
    183 #if defined(BOOST_HAS_DECLSPEC) && (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK)
     183#if defined BOOST_SYMBOL_EXPORT && (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK)
    184184#  if defined(BOOST_REGEX_SOURCE)
    185 #     define BOOST_REGEX_DECL __declspec(dllexport)
     185#     define BOOST_REGEX_DECL BOOST_SYMBOL_EXPORT
    186186#     define BOOST_REGEX_BUILD_DLL
    187187#  else
    188 #     define BOOST_REGEX_DECL __declspec(dllimport)
     188#     define BOOST_REGEX_DECL BOOST_SYMBOL_IMPORT
    189189#  endif
    190190#endif
    191191
  • boost/filesystem/config.hpp

     
    7070#    error Dynamic linking Boost.Filesystem does not work for Borland; use static linking instead
    7171#  endif
    7272
    73 #ifdef BOOST_HAS_DECLSPEC // defined in config system
    7473// we need to import/export our code only if the user has specifically
    7574// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
    7675// libraries to be dynamically linked, or BOOST_FILESYSTEM_DYN_LINK
     
    7877#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
    7978// export if this is our own source, otherwise import:
    8079#ifdef BOOST_FILESYSTEM_SOURCE
    81 # define BOOST_FILESYSTEM_DECL __declspec(dllexport)
     80# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
    8281#else
    83 # define BOOST_FILESYSTEM_DECL __declspec(dllimport)
     82# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
    8483#endif  // BOOST_FILESYSTEM_SOURCE
    8584#endif  // DYN_LINK
    86 #endif  // BOOST_HAS_DECLSPEC
    8785//
    8886// if BOOST_FILESYSTEM_DECL isn't defined yet define it now:
    8987#ifndef BOOST_FILESYSTEM_DECL
  • boost/config.hpp

     
    5656// get config suffix code:
    5757#include <boost/config/suffix.hpp>
    5858
     59//shared libraries symbols export/import
     60#include <boost/config/dso.hpp>
     61
    5962#endif  // BOOST_CONFIG_HPP
    6063
    6164
  • boost/iostreams/detail/config/dyn_link.hpp

     
    2020
    2121//------------------Enable dynamic linking on windows-------------------------//
    2222
    23 #ifdef BOOST_HAS_DECLSPEC
    24 # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_IOSTREAMS_DYN_LINK)
    25 #  ifdef BOOST_IOSTREAMS_SOURCE
    26 #   define BOOST_IOSTREAMS_DECL __declspec(dllexport)
    27 #  else
    28 #   define BOOST_IOSTREAMS_DECL __declspec(dllimport)
    29 #  endif 
     23#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_IOSTREAMS_DYN_LINK)
     24# ifdef BOOST_IOSTREAMS_SOURCE
     25#  define BOOST_IOSTREAMS_DECL BOOST_SYMBOL_EXPORT
     26# else
     27#  define BOOST_IOSTREAMS_DECL BOOST_SYMBOL_IMPORT
    3028# endif 
    31 #endif
     29#endif  
    3230
    3331#ifndef BOOST_IOSTREAMS_DECL
    3432# define BOOST_IOSTREAMS_DECL
  • boost/python/detail/config.hpp

     
    7474#    define BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY 1
    7575#  endif
    7676
    77 #  if BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY
    78 #     if defined(BOOST_PYTHON_SOURCE)
    79 #        define BOOST_PYTHON_DECL __attribute__ ((visibility("default")))
    80 #        define BOOST_PYTHON_BUILD_DLL
    81 #     else
    82 #        define BOOST_PYTHON_DECL
    83 #     endif
    84 #     define BOOST_PYTHON_DECL_FORWARD
    85 #     define BOOST_PYTHON_DECL_EXCEPTION __attribute__ ((visibility("default")))
    86 #  elif (defined(_WIN32) || defined(__CYGWIN__))
    87 #     if defined(BOOST_PYTHON_SOURCE)
    88 #        define BOOST_PYTHON_DECL __declspec(dllexport)
    89 #        define BOOST_PYTHON_BUILD_DLL
    90 #     else
    91 #        define BOOST_PYTHON_DECL __declspec(dllimport)
    92 #     endif
    93 #  endif
     77#  if defined(BOOST_PYTHON_SOURCE)
     78#     define BOOST_PYTHON_BUILD_DLL
     79#     define BOOST_PYTHON_DECL            BOOST_SYMBOL_EXPORT
     80#     define BOOST_PYTHON_DECL_EXCEPTION  BOOST_EXCEPTION_EXPORT
     81#     define BOOST_PYTHON_DECL_FORWARD    BOOST_SYMBOL_FORWARD_EXPORT
     82#  else
     83#     define BOOST_PYTHON_DECL            BOOST_SYMBOL_IMPORT
     84#     define BOOST_PYTHON_DECL_EXCEPTION  BOOST_EXCEPTION_IMPORT
     85#     define BOOST_PYTHON_DECL_FORWARD    BOOST_SYMBOL_FORWARD_IMPORT
     86#endif
    9487
    9588#endif
    9689
  • boost/mpi/config.hpp

     
    8080 *                                                                           *
    8181 *****************************************************************************/
    8282
    83 #if defined(BOOST_HAS_DECLSPEC) && (defined(BOOST_MPI_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_MPI_STATIC_LINK)
     83#if (defined(BOOST_MPI_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_MPI_STATIC_LINK)
    8484#  if defined(BOOST_MPI_SOURCE)
    85 #     define BOOST_MPI_DECL __declspec(dllexport)
     85#     define BOOST_MPI_DECL BOOST_SYMBOL_EXPORT
    8686#     define BOOST_MPI_BUILD_DLL
    8787#  else
    88 #     define BOOST_MPI_DECL __declspec(dllimport)
     88#     define BOOST_MPI_DECL BOOST_SYMBOL_IMPORT
    8989#  endif
    9090#endif
    9191
  • boost/date_time/compiler_config.hpp

     
    118118 *
    119119 */
    120120
    121 #ifdef BOOST_HAS_DECLSPEC // defined in config system
    122    // we need to import/export our code only if the user has specifically
    123    // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
    124    // libraries to be dynamically linked, or BOOST_DATE_TIME_DYN_LINK
    125    // if they want just this one to be dynamically liked:
    126 #  if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK)
    127       // export if this is our own source, otherwise import:
    128 #     ifdef BOOST_DATE_TIME_SOURCE
    129 #       define BOOST_DATE_TIME_DECL __declspec(dllexport)
    130 #     else
    131 #       define BOOST_DATE_TIME_DECL __declspec(dllimport)
    132 #     endif  // BOOST_DATE_TIME_SOURCE
    133 #  endif  // DYN_LINK
    134 #endif  // BOOST_HAS_DECLSPEC
     121// we need to import/export our code only if the user has specifically
     122// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
     123// libraries to be dynamically linked, or BOOST_DATE_TIME_DYN_LINK
     124// if they want just this one to be dynamically liked:
     125#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK)
     126   // export if this is our own source, otherwise import:
     127#  ifdef BOOST_DATE_TIME_SOURCE
     128#    define BOOST_DATE_TIME_DECL BOOST_SYMBOL_EXPORT
     129#  else
     130#    define BOOST_DATE_TIME_DECL BOOST_SYMBOL_IMPORT
     131#  endif  // BOOST_DATE_TIME_SOURCE
     132#endif  // DYN_LINK
    135133//
    136134// if BOOST_WHATEVER_DECL isn't defined yet define it now:
    137135#ifndef BOOST_DATE_TIME_DECL
  • boost/graph/graphviz.hpp

     
    2424#include <boost/graph/adjacency_list.hpp>
    2525#include <boost/dynamic_property_map.hpp>
    2626
    27 #ifdef BOOST_HAS_DECLSPEC
    28 #  if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_GRAPH_DYN_LINK)
    29 #    ifdef BOOST_GRAPH_SOURCE
    30 #      define BOOST_GRAPH_DECL __declspec(dllexport)
    31 #    else
    32 #      define BOOST_GRAPH_DECL __declspec(dllimport)
    33 #    endif  // BOOST_GRAPH_SOURCE
    34 #  endif  // DYN_LINK
    35 #endif  // BOOST_HAS_DECLSPEC
     27#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_GRAPH_DYN_LINK)
     28#  ifdef BOOST_GRAPH_SOURCE
     29#    define BOOST_GRAPH_DECL BOOST_SYMBOL_EXPORT
     30#  else
     31#    define BOOST_GRAPH_DECL BOOST_SYMBOL_IMPORT
     32#  endif  // BOOST_GRAPH_SOURCE
     33#endif  // DYN_LINK
    3634
    3735#ifndef BOOST_GRAPH_DECL
    3836#  define BOOST_GRAPH_DECL
  • boost/program_options/config.hpp

     
    3333
    3434#endif  // BOOST_VERSION
    3535
    36 ///////////////////////////////////////////////////////////////////////////////
    37 // Windows DLL suport
    38 #ifdef BOOST_HAS_DECLSPEC
     36
    3937#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_PROGRAM_OPTIONS_DYN_LINK)
    4038// export if this is our own source, otherwise import:
    4139#ifdef BOOST_PROGRAM_OPTIONS_SOURCE
    42 # define BOOST_PROGRAM_OPTIONS_DECL __declspec(dllexport)
     40# define BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_EXPORT
    4341#else
    44 # define BOOST_PROGRAM_OPTIONS_DECL __declspec(dllimport)
     42# define BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_IMPORT
    4543#endif  // BOOST_PROGRAM_OPTIONS_SOURCE
    4644#endif  // DYN_LINK
    47 #endif  // BOOST_HAS_DECLSPEC
    4845
    4946#ifndef BOOST_PROGRAM_OPTIONS_DECL
    5047#define BOOST_PROGRAM_OPTIONS_DECL
  • boost/config/dso.hpp

     
     1#if !defined BOOST_CONFIG_DYNAMIC_SHARED_OBJECT_SYMBOL_EXPORT_IMPORT_HPP
     2#define BOOST_CONFIG_DYNAMIC_SHARED_OBJECT_SYMBOL_EXPORT_IMPORT_HPP
     3
     4//note: for gcc -fvisibility=hidden or -fvisibility=ms-compat flags
     5//should be passed to compiler
     6
     7#if defined __GNUC__ && __GNUC__ >= 4
     8
     9#  define BOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
     10#  define BOOST_SYMBOL_HIDE   __attribute__((visibility("hidden")))
     11#  define BOOST_SYMBOL_IMPORT
     12#  define BOOST_SYMBOL_FORWARD_EXPORT
     13#  define BOOST_SYMBOL_FORWARD_IMPORT
     14#  define BOOST_EXCEPTION_EXPORT BOOST_SYMBOL_EXPORT
     15#  define BOOST_EXCEPTION_IMPORT BOOST_SYMBOL_EXPORT
     16
     17#elif defined _MSC_VER || defined __BORLANDC__
     18
     19#  define BOOST_SYMBOL_EXPORT __declspec(dllexport)
     20#  define BOOST_SYMBOL_HIDE
     21#  define BOOST_SYMBOL_IMPORT __declspec(dllimport)
     22#  define BOOST_SYMBOL_FORWARD_EXPORT BOOST_SYMBOL_EXPORT
     23#  define BOOST_SYMBOL_FORWARD_IMPORT BOOST_SYMBOL_IMPORT
     24#  define BOOST_EXCEPTION_EXPORT BOOST_SYMBOL_EXPORT
     25#  define BOOST_EXCEPTION_IMPORT BOOST_SYMBOL_IMPORT
     26
     27#endif
     28
     29
     30#if !defined BOOST_SYMBOL_EXPORT
     31#  define BOOST_SYMBOL_EXPORT
     32#  define BOOST_SYMBOL_HIDE
     33#  define BOOST_SYMBOL_IMPORT
     34#  define BOOST_SYMBOL_FORWARD_EXPORT
     35#  define BOOST_SYMBOL_FORWARD_IMPORT
     36#  define BOOST_EXCEPTION_EXPORT
     37#  define BOOST_EXCEPTION_IMPORT
     38#  define BOOST_SYMBOL_FORWARD_EXPORT
     39#  define BOOST_SYMBOL_FORWARD_IMPORT
     40#endif
     41
     42
     43#endif
     44
  • boost/system/config.hpp

     
    3131//#    error Dynamic linking Boost.System does not work for Borland; use static linking instead
    3232//#  endif
    3333
    34 #ifdef BOOST_HAS_DECLSPEC // defined in config system
    3534// we need to import/export our code only if the user has specifically
    3635// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
    3736// libraries to be dynamically linked, or BOOST_SYSTEM_DYN_LINK
     
    3938#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SYSTEM_DYN_LINK)
    4039// export if this is our own source, otherwise import:
    4140#ifdef BOOST_SYSTEM_SOURCE
    42 # define BOOST_SYSTEM_DECL __declspec(dllexport)
     41# define BOOST_SYSTEM_DECL BOOST_SYMBOL_EXPORT
    4342#else
    44 # define BOOST_SYSTEM_DECL __declspec(dllimport)
     43# define BOOST_SYSTEM_DECL BOOST_SYMBOL_IMPORT
    4544#endif  // BOOST_SYSTEM_SOURCE
    4645#endif  // DYN_LINK
    47 #endif  // BOOST_HAS_DECLSPEC
    4846//
    4947// if BOOST_SYSTEM_DECL isn't defined yet define it now:
    5048#ifndef BOOST_SYSTEM_DECL