config.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef BOOST_METAPARSE_CONFIG_HPP
  2. #define BOOST_METAPARSE_CONFIG_HPP
  3. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #include <boost/config.hpp>
  8. /*
  9. * Compiler workarounds
  10. */
  11. // BOOST_NO_CXX11_CONSTEXPR is not defined in gcc 4.6
  12. #if \
  13. defined BOOST_NO_CXX11_CONSTEXPR || defined BOOST_NO_CONSTEXPR || ( \
  14. !defined __clang__ && defined __GNUC__ \
  15. && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)) \
  16. )
  17. # define BOOST_NO_CONSTEXPR_C_STR
  18. #endif
  19. /*
  20. * C++ standard to use
  21. */
  22. // Allow overriding this
  23. #ifndef BOOST_METAPARSE_STD
  24. // special-case MSCV >= 1900 as its constexpr support is good enough for
  25. // Metaparse
  26. # if \
  27. !defined BOOST_NO_CXX11_VARIADIC_TEMPLATES \
  28. && !defined BOOST_NO_VARIADIC_TEMPLATES \
  29. && ( \
  30. (!defined BOOST_NO_CONSTEXPR && !defined BOOST_NO_CXX11_CONSTEXPR) \
  31. || (defined _MSC_VER && _MSC_VER >= 1900) \
  32. ) \
  33. && (!defined BOOST_GCC || BOOST_GCC >= 40700)
  34. # define BOOST_METAPARSE_STD 2011
  35. # else
  36. # define BOOST_METAPARSE_STD 1998
  37. # endif
  38. #endif
  39. /*
  40. * Metaparse config
  41. */
  42. #if BOOST_METAPARSE_STD >= 2011
  43. # define BOOST_METAPARSE_VARIADIC_STRING
  44. #endif
  45. #endif