config.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright Takatoshi Kondo 2020
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #if !defined(MQTT_CONFIG_HPP)
  7. #define MQTT_CONFIG_HPP
  8. #if !defined(MQTT_STD_VARIANT)
  9. // Use boost variant
  10. // user intentionally defined BOOST_MPL_LIMIT_LIST_SIZE but size is too small
  11. // NOTE: if BOOST_MPL_LIMIT_LIST_SIZE is not defined, the value is evaluate as 0.
  12. #if defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) && BOOST_MPL_LIMIT_LIST_SIZE < 40
  13. #error BOOST_MPL_LIMIT_LIST_SIZE need to greator or equal to 40
  14. #else // defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) && BOOST_MPL_LIMIT_LIST_SIZE < 40
  15. // user doesn't define BOOST_MPL_LIMIT_LIST_SIZE intentionally
  16. // but the defult value could be defined
  17. #undef BOOST_MPL_LIMIT_LIST_SIZE
  18. #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  19. #define BOOST_MPL_LIMIT_LIST_SIZE 40
  20. #endif // defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) && BOOST_MPL_LIMIT_LIST_SIZE < 40
  21. #endif // !defined(MQTT_STD_VARIANT)
  22. // Determine Boost Asio version
  23. #include <boost/asio/version.hpp>
  24. // Make sure standard executors are supported by Boost Asio
  25. #if BOOST_ASIO_VERSION < 101800
  26. #error Boost Asio version 1.18.0 required for no TS-style executors
  27. #endif // BOOST_ASIO_VERSION < 101800
  28. #define BOOST_UUID_FORCE_AUTO_LINK
  29. #endif // MQTT_CONFIG_HPP