config.hpp 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // note lack of include guards. This is intentional
  2. // config.hpp ---------------------------------------------//
  3. // (c) Copyright Robert Ramey 2004
  4. // Use, modification, and distribution is subject to the Boost Software
  5. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. // See library home page at http://www.boost.org/libs/serialization
  8. //----------------------------------------------------------------------------//
  9. // This header implements separate compilation features as described in
  10. // http://www.boost.org/more/separate_compilation.html
  11. #include <boost/config.hpp>
  12. #include <boost/detail/workaround.hpp>
  13. #include <boost/preprocessor/facilities/empty.hpp>
  14. // note: this version incorporates the related code into the the
  15. // the same library as BOOST_ARCHIVE. This could change some day in the
  16. // future
  17. // if BOOST_SERIALIZATION_DECL is defined undefine it now:
  18. #ifdef BOOST_SERIALIZATION_DECL
  19. #undef BOOST_SERIALIZATION_DECL
  20. #endif
  21. #ifdef BOOST_HAS_DECLSPEC // defined in config system
  22. // we need to import/export our code only if the user has specifically
  23. // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
  24. // libraries to be dynamically linked, or BOOST_SERIALIZATION_DYN_LINK
  25. // if they want just this one to be dynamically liked:
  26. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)
  27. #if !defined(BOOST_DYN_LINK)
  28. #define BOOST_DYN_LINK
  29. #endif
  30. // export if this is our own source, otherwise import:
  31. #if defined(BOOST_SERIALIZATION_SOURCE)
  32. #if defined(__BORLANDC__)
  33. #define BOOST_SERIALIZATION_DECL(T) T __export
  34. #else
  35. #define BOOST_SERIALIZATION_DECL(T) __declspec(dllexport) T
  36. #endif
  37. #else
  38. #if defined(__BORLANDC__)
  39. #define BOOST_SERIALIZATION_DECL(T) T __import
  40. #else
  41. #define BOOST_SERIALIZATION_DECL(T) __declspec(dllimport) T
  42. #endif
  43. #endif // defined(BOOST_SERIALIZATION_SOURCE)
  44. #endif // defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)
  45. #endif // BOOST_HAS_DECLSPEC
  46. // if BOOST_SERIALIZATION_DECL isn't defined yet define it now:
  47. #ifndef BOOST_SERIALIZATION_DECL
  48. #define BOOST_SERIALIZATION_DECL(T) T
  49. #endif
  50. // enable automatic library variant selection ------------------------------//
  51. #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SERIALIZATION_NO_LIB) \
  52. && !defined(BOOST_ARCHIVE_SOURCE) && !defined(BOOST_WARCHIVE_SOURCE) \
  53. && !defined(BOOST_SERIALIZATION_SOURCE)
  54. //
  55. // Set the name of our library, this will get undef'ed by auto_link.hpp
  56. // once it's done with it:
  57. //
  58. #define BOOST_LIB_NAME boost_serialization
  59. //
  60. // If we're importing code from a dll, then tell auto_link.hpp about it:
  61. //
  62. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)
  63. # define BOOST_DYN_LINK
  64. #endif
  65. //
  66. // And include the header that does the work:
  67. //
  68. #include <boost/config/auto_link.hpp>
  69. #endif