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