force_include.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef BOOST_SERIALIZATION_FORCE_INCLUDE_HPP
  2. #define BOOST_SERIALIZATION_FORCE_INCLUDE_HPP
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  8. // force_include.hpp:
  9. // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
  10. // Use, modification and distribution is subject to the Boost Software
  11. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. // See http://www.boost.org for updates, documentation, and revision history.
  14. #include <boost/config.hpp>
  15. // the following help macro is to guarentee that certain coded
  16. // is not removed by over-eager linker optimiser. In certain cases
  17. // we create static objects must be created but are actually never
  18. // referenced - creation has a side-effect such as global registration
  19. // which is important to us. We make an effort to refer these objects
  20. // so that a smart linker won't remove them as being unreferenced.
  21. // In microsoft compilers, inlining the code that does the referring
  22. // means the code gets lost and the static object is not included
  23. // in the library and hence never registered. This manifests itself
  24. // in an ungraceful crash at runtime when (and only when) built in
  25. // release mode.
  26. #if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__)
  27. # if defined(__BORLANDC__)
  28. # define BOOST_DLLEXPORT __export
  29. # else
  30. # define BOOST_DLLEXPORT __declspec(dllexport)
  31. # endif
  32. #elif ! defined(_WIN32) && ! defined(_WIN64)
  33. # if defined(__MWERKS__)
  34. # define BOOST_DLLEXPORT __declspec(dllexport)
  35. # elif defined(__GNUC__) && (__GNUC__ >= 3)
  36. # define BOOST_USED __attribute__ ((used))
  37. # elif defined(__INTEL_COMPILER) && (BOOST_INTEL_CXX_VERSION >= 800)
  38. # define BOOST_USED __attribute__ ((used))
  39. # endif
  40. #endif
  41. #ifndef BOOST_USED
  42. # define BOOST_USED
  43. #endif
  44. #ifndef BOOST_DLLEXPORT
  45. # define BOOST_DLLEXPORT
  46. #endif
  47. #endif // BOOST_SERIALIZATION_FORCE_INCLUDE_HPP