force_include.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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)
  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. # define BOOST_DLLEXPORT __declspec(dllexport)
  28. #elif ! defined(_WIN32) && ! defined(_WIN64)
  29. # if defined(__MWERKS__)
  30. # define BOOST_DLLEXPORT __declspec(dllexport)
  31. # elif defined(__GNUC__) && (__GNUC__ >= 3)
  32. # define BOOST_USED __attribute__ ((__used__))
  33. # elif defined(__IBMCPP__) && (__IBMCPP__ >= 1110)
  34. # define BOOST_USED __attribute__ ((__used__))
  35. # elif defined(__INTEL_COMPILER) && (BOOST_INTEL_CXX_VERSION >= 800)
  36. # define BOOST_USED __attribute__ ((__used__))
  37. # endif
  38. #endif
  39. #ifndef BOOST_USED
  40. # define BOOST_USED
  41. #endif
  42. #ifndef BOOST_DLLEXPORT
  43. # define BOOST_DLLEXPORT
  44. #endif
  45. #endif // BOOST_SERIALIZATION_FORCE_INCLUDE_HPP