config.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. # if !defined BOOST_NO_CXX14_CONSTEXPR
  35. # define BOOST_METAPARSE_STD 2014
  36. # else
  37. # define BOOST_METAPARSE_STD 2011
  38. # endif
  39. # else
  40. # define BOOST_METAPARSE_STD 1998
  41. # endif
  42. #endif
  43. /*
  44. * Metaparse config
  45. */
  46. #if BOOST_METAPARSE_STD >= 2011
  47. # define BOOST_METAPARSE_VARIADIC_STRING
  48. #endif
  49. #endif