config.hpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // https://www.boost.org/LICENSE_1_0.txt
  6. #ifndef BOOST_LOCALE_CONFIG_HPP_INCLUDED
  7. #define BOOST_LOCALE_CONFIG_HPP_INCLUDED
  8. #include <boost/config.hpp>
  9. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_LOCALE_DYN_LINK)
  10. # ifdef BOOST_LOCALE_SOURCE
  11. # define BOOST_LOCALE_DECL BOOST_SYMBOL_EXPORT
  12. # else
  13. # define BOOST_LOCALE_DECL BOOST_SYMBOL_IMPORT
  14. # endif // BOOST_LOCALE_SOURCE
  15. #else
  16. # define BOOST_LOCALE_DECL
  17. #endif // BOOST_LOCALE_DYN_LINK
  18. //
  19. // Automatically link to the correct build variant where possible.
  20. //
  21. #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_LOCALE_NO_LIB) && !defined(BOOST_LOCALE_SOURCE)
  22. //
  23. // Set the name of our library, this will get undef'ed by auto_link.hpp
  24. // once it's done with it:
  25. //
  26. # define BOOST_LIB_NAME boost_locale
  27. //
  28. // If we're importing code from a dll, then tell auto_link.hpp about it:
  29. //
  30. # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_LOCALE_DYN_LINK)
  31. # define BOOST_DYN_LINK
  32. # endif
  33. //
  34. // And include the header that does the work:
  35. //
  36. # include <boost/config/auto_link.hpp>
  37. #endif // auto-linking disabled
  38. // Check for some C++11 features to provide easier checks for what is missing
  39. // shortly after the requirement of C++11 in Boost 1.81
  40. // clang-format off
  41. #if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || \
  42. defined(BOOST_NO_CXX11_DEFAULTED_MOVES) || \
  43. defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) || \
  44. defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) || \
  45. defined(BOOST_NO_CXX11_NOEXCEPT) || \
  46. defined(BOOST_NO_CXX11_OVERRIDE) || \
  47. defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
  48. defined(BOOST_NO_CXX11_SMART_PTR) || \
  49. defined(BOOST_NO_CXX11_STATIC_ASSERT)
  50. // clang-format on
  51. # error "Boost.Locale requires C++11 since Boost 1.81."
  52. #endif
  53. #ifdef _MSC_VER
  54. // Denote a constant condition, e.g. for if(sizeof(...
  55. # define BOOST_LOCALE_START_CONST_CONDITION __pragma(warning(push)) __pragma(warning(disable : 4127))
  56. # define BOOST_LOCALE_END_CONST_CONDITION __pragma(warning(pop))
  57. #else
  58. # define BOOST_LOCALE_START_CONST_CONDITION
  59. # define BOOST_LOCALE_END_CONST_CONDITION
  60. #endif
  61. /// \cond INTERNAL
  62. #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
  63. // Internal define to check if we have access to the Win32 API
  64. # define BOOST_LOCALE_USE_WIN32_API 1
  65. #else
  66. # define BOOST_LOCALE_USE_WIN32_API 0
  67. #endif
  68. /// \endcond
  69. #endif // boost/locale/config.hpp