config.hpp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. // boost/filesystem/v3/config.hpp ----------------------------------------------------//
  2. // Copyright Beman Dawes 2003
  3. // Copyright Andrey Semashev 2021-2023
  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. // Deprecated symbols markup -----------------------------------------------------------//
  52. #if !defined(BOOST_FILESYSTEM_ALLOW_DEPRECATED)
  53. #define BOOST_FILESYSTEM_DETAIL_DEPRECATED(msg) BOOST_DEPRECATED(msg)
  54. #else
  55. #define BOOST_FILESYSTEM_DETAIL_DEPRECATED(msg)
  56. #endif
  57. // This header implements separate compilation features as described in
  58. // http://www.boost.org/more/separate_compilation.html
  59. // normalize macros ------------------------------------------------------------------//
  60. #if !defined(BOOST_FILESYSTEM_DYN_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK) && !defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_ALL_STATIC_LINK)
  61. #define BOOST_FILESYSTEM_STATIC_LINK
  62. #endif
  63. #if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_FILESYSTEM_DYN_LINK)
  64. #define BOOST_FILESYSTEM_DYN_LINK
  65. #elif defined(BOOST_ALL_STATIC_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK)
  66. #define BOOST_FILESYSTEM_STATIC_LINK
  67. #endif
  68. #if defined(BOOST_FILESYSTEM_DYN_LINK) && defined(BOOST_FILESYSTEM_STATIC_LINK)
  69. #error Must not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK
  70. #endif
  71. #if defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
  72. #define BOOST_FILESYSTEM_NO_LIB
  73. #endif
  74. // enable dynamic linking ------------------------------------------------------------//
  75. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
  76. #if defined(BOOST_FILESYSTEM_SOURCE)
  77. #define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
  78. #else
  79. #define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
  80. #endif
  81. #else
  82. #define BOOST_FILESYSTEM_DECL
  83. #endif
  84. // enable automatic library variant selection ----------------------------------------//
  85. #if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
  86. //
  87. // Set the name of our library, this will get undef'ed by auto_link.hpp
  88. // once it's done with it:
  89. //
  90. #define BOOST_LIB_NAME boost_filesystem
  91. //
  92. // If we're importing code from a dll, then tell auto_link.hpp about it:
  93. //
  94. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
  95. #define BOOST_DYN_LINK
  96. #endif
  97. //
  98. // And include the header that does the work:
  99. //
  100. #include <boost/config/auto_link.hpp>
  101. #endif // auto-linking disabled
  102. #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) ||\
  103. (defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 50000)) ||\
  104. (defined(BOOST_MSSTL_VERSION) && (BOOST_MSSTL_VERSION < 100))
  105. // Indicates that the standard library fstream types do not support move constructor/assignment.
  106. #define BOOST_FILESYSTEM_DETAIL_NO_CXX11_MOVABLE_FSTREAMS
  107. #endif
  108. #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW) && \
  109. (\
  110. (defined(BOOST_DINKUMWARE_STDLIB) && defined(_HAS_CXX23) && (_HAS_CXX23 != 0) && defined(_MSVC_STL_UPDATE) && (_MSVC_STL_UPDATE < 202208L)) || \
  111. (defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 110400 || (BOOST_LIBSTDCXX_VERSION >= 120000 && BOOST_LIBSTDCXX_VERSION < 120200)) && (BOOST_CXX_VERSION > 202002L))\
  112. )
  113. // Indicates that std::string_view has implicit constructor from ranges that was present in an early C++23 draft (N4892).
  114. // This was later rectified by marking the constructor explicit (https://wg21.link/p2499). Unfortunately, some compilers
  115. // were released with the constructor being implicit.
  116. #define BOOST_FILESYSTEM_DETAIL_CXX23_STRING_VIEW_HAS_IMPLICIT_RANGE_CTOR
  117. #endif
  118. #endif // BOOST_FILESYSTEM_CONFIG_HPP