config.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // boost/endian/detail/config.hpp ----------------------------------------------------//
  2. // Copyright Beman Dawes 2003, 2010
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // See http://www.boost.org/LICENSE_1_0.txt
  5. //--------------------------------------------------------------------------------------//
  6. #ifndef BOOST_ENDIAN_CONFIG_HPP
  7. #define BOOST_ENDIAN_CONFIG_HPP
  8. // This header implements separate compilation features as described in
  9. // http://www.boost.org/more/separate_compilation.html
  10. #include <boost/config.hpp>
  11. #include <boost/system/api_config.hpp> // for BOOST_POSIX_API or BOOST_WINDOWS_API
  12. // throw an exception ----------------------------------------------------------------//
  13. //
  14. // Exceptions were originally thrown via boost::throw_exception().
  15. // As throw_exception() became more complex, it caused user error reporting
  16. // to be harder to interpret, since the exception reported became much more complex.
  17. // The immediate fix was to throw directly, wrapped in a macro to make any later change
  18. // easier.
  19. #define BOOST_ENDIAN_THROW(EX) throw EX
  20. // enable dynamic linking -------------------------------------------------------------//
  21. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_ENDIAN_DYN_LINK)
  22. # if defined(BOOST_ENDIAN_SOURCE)
  23. # define BOOST_ENDIAN_DECL BOOST_SYMBOL_EXPORT
  24. # else
  25. # define BOOST_ENDIAN_DECL BOOST_SYMBOL_IMPORT
  26. # endif
  27. #else
  28. # define BOOST_ENDIAN_DECL
  29. #endif
  30. // enable automatic library variant selection ----------------------------------------//
  31. #if !defined(BOOST_ENDIAN_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
  32. && !defined(BOOST_ENDIAN_NO_LIB)
  33. //
  34. // Set the name of our library, this will get undef'ed by auto_link.hpp
  35. // once it's done with it:
  36. //
  37. #define BOOST_LIB_NAME boost_endian
  38. //
  39. // If we're importing code from a dll, then tell auto_link.hpp about it:
  40. //
  41. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_ENDIAN_DYN_LINK)
  42. # define BOOST_DYN_LINK
  43. #endif
  44. //
  45. // And include the header that does the work:
  46. //
  47. #include <boost/config/auto_link.hpp>
  48. #endif // auto-linking disabled
  49. #endif // BOOST_ENDIAN_CONFIG_HPP