config.hpp 3.1 KB

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