config.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MYSQL_DETAIL_CONFIG_HPP
  8. #define BOOST_MYSQL_DETAIL_CONFIG_HPP
  9. #include <boost/config.hpp>
  10. // clang-format off
  11. // Concepts
  12. #if defined(__cpp_concepts) && defined(__cpp_lib_concepts)
  13. #define BOOST_MYSQL_HAS_CONCEPTS
  14. #endif
  15. // C++14 conformance
  16. #if BOOST_CXX_VERSION >= 201402L
  17. #define BOOST_MYSQL_CXX14
  18. #endif
  19. // Consteval
  20. #ifdef __cpp_consteval
  21. #define BOOST_MYSQL_CONSTEVAL consteval
  22. #else
  23. #define BOOST_MYSQL_CONSTEVAL constexpr
  24. #endif
  25. // Separate build
  26. #if defined(BOOST_MYSQL_SEPARATE_COMPILATION)
  27. #define BOOST_MYSQL_DECL
  28. #else
  29. #define BOOST_MYSQL_HEADER_ONLY
  30. #define BOOST_MYSQL_DECL inline
  31. #endif
  32. // Auto return type. Having this as a macro helps the documentation tool.
  33. #ifdef BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
  34. #define BOOST_MYSQL_RETURN_TYPE(...) -> __VA_ARGS__
  35. #else
  36. #define BOOST_MYSQL_RETURN_TYPE(...)
  37. #endif
  38. // Chrono calendar types and functions
  39. #if __cpp_lib_chrono >= 201907L
  40. #define BOOST_MYSQL_HAS_LOCAL_TIME
  41. #endif
  42. // clang-format on
  43. #endif