config.hpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. # endif
  25. // throw an exception ----------------------------------------------------------------//
  26. //
  27. // Exceptions were originally thrown via boost::throw_exception().
  28. // As throw_exception() became more complex, it caused user error reporting
  29. // to be harder to interpret, since the exception reported became much more complex.
  30. // The immediate fix was to throw directly, wrapped in a macro to make any later change
  31. // easier.
  32. #define BOOST_FILESYSTEM_THROW(EX) throw EX
  33. # if defined( BOOST_NO_STD_WSTRING )
  34. # error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
  35. # endif
  36. // This header implements separate compilation features as described in
  37. // http://www.boost.org/more/separate_compilation.html
  38. // normalize macros ------------------------------------------------------------------//
  39. #if !defined(BOOST_FILESYSTEM_DYN_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK) \
  40. && !defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_ALL_STATIC_LINK)
  41. # define BOOST_FILESYSTEM_STATIC_LINK
  42. #endif
  43. #if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_FILESYSTEM_DYN_LINK)
  44. # define BOOST_FILESYSTEM_DYN_LINK
  45. #elif defined(BOOST_ALL_STATIC_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK)
  46. # define BOOST_FILESYSTEM_STATIC_LINK
  47. #endif
  48. #if defined(BOOST_FILESYSTEM_DYN_LINK) && defined(BOOST_FILESYSTEM_STATIC_LINK)
  49. # error Must not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK
  50. #endif
  51. #if defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
  52. # define BOOST_FILESYSTEM_NO_LIB
  53. #endif
  54. // enable dynamic linking ------------------------------------------------------------//
  55. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
  56. # if defined(BOOST_FILESYSTEM_SOURCE)
  57. # define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
  58. # else
  59. # define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
  60. # endif
  61. #else
  62. # define BOOST_FILESYSTEM_DECL
  63. #endif
  64. // enable automatic library variant selection ----------------------------------------//
  65. #if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
  66. && !defined(BOOST_FILESYSTEM_NO_LIB)
  67. //
  68. // Set the name of our library, this will get undef'ed by auto_link.hpp
  69. // once it's done with it:
  70. //
  71. #define BOOST_LIB_NAME boost_filesystem
  72. //
  73. // If we're importing code from a dll, then tell auto_link.hpp about it:
  74. //
  75. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
  76. # define BOOST_DYN_LINK
  77. #endif
  78. //
  79. // And include the header that does the work:
  80. //
  81. #include <boost/config/auto_link.hpp>
  82. #endif // auto-linking disabled
  83. #endif // BOOST_FILESYSTEM3_CONFIG_HPP