config.hpp 4.4 KB

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