config.hpp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. #define BOOST_FILESYSTEM_VERSION_NAMESPACE BOOST_JOIN(v, BOOST_FILESYSTEM_VERSION)
  26. #if BOOST_FILESYSTEM_VERSION == 4
  27. #undef BOOST_FILESYSTEM_DEPRECATED
  28. #if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
  29. #define BOOST_FILESYSTEM_NO_DEPRECATED
  30. #endif
  31. #endif
  32. #define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
  33. // BOOST_FILESYSTEM_DEPRECATED needed for source compiles -----------------------------//
  34. #ifdef BOOST_FILESYSTEM_SOURCE
  35. #define BOOST_FILESYSTEM_DEPRECATED
  36. #undef BOOST_FILESYSTEM_NO_DEPRECATED // fixes #9454, src bld fails if NO_DEP defined
  37. #endif
  38. #if defined(BOOST_FILESYSTEM_DEPRECATED) && defined(BOOST_FILESYSTEM_NO_DEPRECATED)
  39. #error Both BOOST_FILESYSTEM_DEPRECATED and BOOST_FILESYSTEM_NO_DEPRECATED are defined
  40. #endif
  41. // throw an exception ----------------------------------------------------------------//
  42. //
  43. // Exceptions were originally thrown via boost::throw_exception().
  44. // As throw_exception() became more complex, it caused user error reporting
  45. // to be harder to interpret, since the exception reported became much more complex.
  46. // The immediate fix was to throw directly, wrapped in a macro to make any later change
  47. // easier.
  48. #define BOOST_FILESYSTEM_THROW(EX) throw EX
  49. #if defined(BOOST_NO_STD_WSTRING)
  50. #error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
  51. #endif
  52. // Deprecated symbols markup -----------------------------------------------------------//
  53. #if !defined(BOOST_FILESYSTEM_ALLOW_DEPRECATED)
  54. #define BOOST_FILESYSTEM_DETAIL_DEPRECATED(msg) BOOST_DEPRECATED(msg)
  55. #else
  56. #define BOOST_FILESYSTEM_DETAIL_DEPRECATED(msg)
  57. #endif
  58. // This header implements separate compilation features as described in
  59. // http://www.boost.org/more/separate_compilation.html
  60. // normalize macros ------------------------------------------------------------------//
  61. #if !defined(BOOST_FILESYSTEM_DYN_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK) && !defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_ALL_STATIC_LINK)
  62. #define BOOST_FILESYSTEM_STATIC_LINK
  63. #endif
  64. #if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_FILESYSTEM_DYN_LINK)
  65. #define BOOST_FILESYSTEM_DYN_LINK
  66. #elif defined(BOOST_ALL_STATIC_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK)
  67. #define BOOST_FILESYSTEM_STATIC_LINK
  68. #endif
  69. #if defined(BOOST_FILESYSTEM_DYN_LINK) && defined(BOOST_FILESYSTEM_STATIC_LINK)
  70. #error Must not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK
  71. #endif
  72. #if defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
  73. #define BOOST_FILESYSTEM_NO_LIB
  74. #endif
  75. // enable dynamic linking ------------------------------------------------------------//
  76. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
  77. #if defined(BOOST_FILESYSTEM_SOURCE)
  78. #define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
  79. #else
  80. #define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
  81. #endif
  82. #else
  83. #define BOOST_FILESYSTEM_DECL
  84. #endif
  85. // enable automatic library variant selection ----------------------------------------//
  86. #if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
  87. //
  88. // Set the name of our library, this will get undef'ed by auto_link.hpp
  89. // once it's done with it:
  90. //
  91. #define BOOST_LIB_NAME boost_filesystem
  92. //
  93. // If we're importing code from a dll, then tell auto_link.hpp about it:
  94. //
  95. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
  96. #define BOOST_DYN_LINK
  97. #endif
  98. //
  99. // And include the header that does the work:
  100. //
  101. #include <boost/config/auto_link.hpp>
  102. #endif // auto-linking disabled
  103. #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) ||\
  104. (defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 50000)) ||\
  105. (defined(BOOST_MSSTL_VERSION) && (BOOST_MSSTL_VERSION < 100))
  106. // Indicates that the standard library fstream types do not support move constructor/assignment.
  107. #define BOOST_FILESYSTEM_DETAIL_NO_CXX11_MOVABLE_FSTREAMS
  108. #endif
  109. #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW) && \
  110. (\
  111. (defined(BOOST_DINKUMWARE_STDLIB) && defined(_HAS_CXX23) && (_HAS_CXX23 != 0) && defined(_MSVC_STL_UPDATE) && (_MSVC_STL_UPDATE < 202208L)) || \
  112. (defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 110400 || (BOOST_LIBSTDCXX_VERSION >= 120000 && BOOST_LIBSTDCXX_VERSION < 120200)) && (BOOST_CXX_VERSION > 202002L))\
  113. )
  114. // Indicates that std::string_view has implicit constructor from ranges that was present in an early C++23 draft (N4892).
  115. // This was later rectified by marking the constructor explicit (https://wg21.link/p2499). Unfortunately, some compilers
  116. // were released with the constructor being implicit.
  117. #define BOOST_FILESYSTEM_DETAIL_CXX23_STRING_VIEW_HAS_IMPLICIT_RANGE_CTOR
  118. #endif
  119. #endif // BOOST_FILESYSTEM_CONFIG_HPP