config.hpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // boost/system/config.hpp -------------------------------------------------//
  2. // Copyright Beman Dawes 2003, 2006
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/system for documentation.
  6. #ifndef BOOST_SYSTEM_CONFIG_HPP
  7. #define BOOST_SYSTEM_CONFIG_HPP
  8. #include <boost/config.hpp>
  9. // BOOST_POSIX_API or BOOST_WINDOWS_API specify which API to use.
  10. // If not specified, a sensible default will be applied.
  11. # if defined( BOOST_WINDOWS_API ) && defined( BOOST_POSIX_API )
  12. # error both BOOST_WINDOWS_API and BOOST_POSIX_API are defined
  13. # elif !defined( BOOST_WINDOWS_API ) && !defined( BOOST_POSIX_API )
  14. # if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
  15. # define BOOST_WINDOWS_API
  16. # else
  17. # define BOOST_POSIX_API
  18. # endif
  19. # endif
  20. // enable dynamic linking on Windows ---------------------------------------//
  21. //# if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SYSTEM_DYN_LINK)) && defined(__BORLANDC__) && defined(__WIN32__)
  22. //# error Dynamic linking Boost.System does not work for Borland; use static linking instead
  23. //# endif
  24. #ifdef BOOST_HAS_DECLSPEC // defined in config system
  25. // we need to import/export our code only if the user has specifically
  26. // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
  27. // libraries to be dynamically linked, or BOOST_SYSTEM_DYN_LINK
  28. // if they want just this one to be dynamically liked:
  29. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SYSTEM_DYN_LINK)
  30. // export if this is our own source, otherwise import:
  31. #ifdef BOOST_SYSTEM_SOURCE
  32. # define BOOST_SYSTEM_DECL __declspec(dllexport)
  33. #else
  34. # define BOOST_SYSTEM_DECL __declspec(dllimport)
  35. #endif // BOOST_SYSTEM_SOURCE
  36. #endif // DYN_LINK
  37. #endif // BOOST_HAS_DECLSPEC
  38. //
  39. // if BOOST_SYSTEM_DECL isn't defined yet define it now:
  40. #ifndef BOOST_SYSTEM_DECL
  41. #define BOOST_SYSTEM_DECL
  42. #endif
  43. // enable automatic library variant selection ------------------------------//
  44. #if !defined(BOOST_SYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SYSTEM_NO_LIB)
  45. //
  46. // Set the name of our library, this will get undef'ed by auto_link.hpp
  47. // once it's done with it:
  48. //
  49. #define BOOST_LIB_NAME boost_system
  50. //
  51. // If we're importing code from a dll, then tell auto_link.hpp about it:
  52. //
  53. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SYSTEM_DYN_LINK)
  54. # define BOOST_DYN_LINK
  55. #endif
  56. //
  57. // And include the header that does the work:
  58. //
  59. #include <boost/config/auto_link.hpp>
  60. #endif // auto-linking disabled
  61. #endif // BOOST_SYSTEM_CONFIG_HPP