config.hpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. // boost/filesystem/v3/config.hpp ----------------------------------------------------//
  2. // Copyright Beman Dawes 2003
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // See http://www.boost.org/LICENSE_1_0.txt
  5. // Library home page: http://www.boost.org/libs/filesystem
  6. //--------------------------------------------------------------------------------------//
  7. #ifndef BOOST_FILESYSTEM3_CONFIG_HPP
  8. #define BOOST_FILESYSTEM3_CONFIG_HPP
  9. # if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION != 3
  10. # error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
  11. # endif
  12. # if !defined(BOOST_FILESYSTEM_VERSION)
  13. # define BOOST_FILESYSTEM_VERSION 3
  14. # endif
  15. #define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
  16. // This header implements separate compilation features as described in
  17. // http://www.boost.org/more/separate_compilation.html
  18. #include <boost/config.hpp>
  19. #include <boost/system/api_config.hpp> // for BOOST_POSIX_API or BOOST_WINDOWS_API
  20. #include <boost/detail/workaround.hpp>
  21. // BOOST_FILESYSTEM_DEPRECATED needed for source compiles -----------------------------//
  22. # ifdef BOOST_FILESYSTEM_SOURCE
  23. # define BOOST_FILESYSTEM_DEPRECATED
  24. # undef BOOST_FILESYSTEM_NO_DEPRECATED // fixes #9454, src bld fails if NO_DEP defined
  25. # endif
  26. // throw an exception ----------------------------------------------------------------//
  27. //
  28. // Exceptions were originally thrown via boost::throw_exception().
  29. // As throw_exception() became more complex, it caused user error reporting
  30. // to be harder to interpret, since the exception reported became much more complex.
  31. // The immediate fix was to throw directly, wrapped in a macro to make any later change
  32. // easier.
  33. #define BOOST_FILESYSTEM_THROW(EX) throw EX
  34. # if defined( BOOST_NO_STD_WSTRING )
  35. # error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
  36. # endif
  37. // This header implements separate compilation features as described in
  38. // http://www.boost.org/more/separate_compilation.html
  39. // normalize macros ------------------------------------------------------------------//
  40. #if !defined(BOOST_FILESYSTEM_DYN_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK) \
  41. && !defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_ALL_STATIC_LINK)
  42. # define BOOST_FILESYSTEM_STATIC_LINK
  43. #endif
  44. #if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_FILESYSTEM_DYN_LINK)
  45. # define BOOST_FILESYSTEM_DYN_LINK
  46. #elif defined(BOOST_ALL_STATIC_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK)
  47. # define BOOST_FILESYSTEM_STATIC_LINK
  48. #endif
  49. #if defined(BOOST_FILESYSTEM_DYN_LINK) && defined(BOOST_FILESYSTEM_STATIC_LINK)
  50. # error Must not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK
  51. #endif
  52. #if defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
  53. # define BOOST_FILESYSTEM_NO_LIB
  54. #endif
  55. // enable dynamic linking ------------------------------------------------------------//
  56. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
  57. # if defined(BOOST_FILESYSTEM_SOURCE)
  58. # define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
  59. # else
  60. # define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
  61. # endif
  62. #else
  63. # define BOOST_FILESYSTEM_DECL
  64. #endif
  65. // enable automatic library variant selection ----------------------------------------//
  66. #if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
  67. && !defined(BOOST_FILESYSTEM_NO_LIB)
  68. //
  69. // Set the name of our library, this will get undef'ed by auto_link.hpp
  70. // once it's done with it:
  71. //
  72. #define BOOST_LIB_NAME boost_filesystem
  73. //
  74. // If we're importing code from a dll, then tell auto_link.hpp about it:
  75. //
  76. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
  77. # define BOOST_DYN_LINK
  78. #endif
  79. //
  80. // And include the header that does the work:
  81. //
  82. #include <boost/config/auto_link.hpp>
  83. #endif // auto-linking disabled
  84. #endif // BOOST_FILESYSTEM3_CONFIG_HPP