x3.hpp 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*=============================================================================
  2. Copyright (c) 2001-2013 Joel de Guzman
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #if !defined(BOOST_SPIRIT_X3_MARCH_04_2007_0852PM)
  7. #define BOOST_SPIRIT_X3_MARCH_04_2007_0852PM
  8. #if defined(_MSC_VER)
  9. #pragma once
  10. #endif
  11. #if !defined BOOST_SPIRIT_X3_HIDE_CXX17_WARNING && !( true \
  12. && defined __cpp_if_constexpr && __cpp_if_constexpr >= 201606 \
  13. && defined __cpp_inline_variables && __cpp_inline_variables >= 201606 \
  14. && defined __cpp_fold_expressions && __cpp_fold_expressions >= 201603 \
  15. && defined __cpp_variadic_using && __cpp_variadic_using >= 201611 \
  16. && (defined __cpp_template_auto && __cpp_template_auto >= 201606 \
  17. || defined __cpp_nontype_template_parameter_auto && __cpp_nontype_template_parameter_auto >= 201606) \
  18. && defined __cpp_nontype_template_args && __cpp_nontype_template_args >= 201411 \
  19. )
  20. # define BOOST_SPIRIT_X3_STRINGIZE_IMPL(x) #x
  21. # define BOOST_SPIRIT_X3_STRINGIZE(x) BOOST_SPIRIT_X3_STRINGIZE_IMPL(x)
  22. # if defined __GNUC__ || defined __clang__
  23. # warning "Spirit X3 will soon use C++17 features which your compiler does not support"
  24. # if (defined __clang__ && __clang_major__ >= 4 || __GNUC__ >= 7) && __cplusplus < 201703L
  25. # warning "Use -std=c++17 or -std=gnu++17 compiler flag to enable C++17 mode"
  26. # endif
  27. # warning "Minimal supported compiler versions: Clang 4 / GCC 7 / MSC 1915 (VS 2017 v15.8)"
  28. # if defined __clang__
  29. # pragma message "This compiler seems to be Clang " BOOST_SPIRIT_X3_STRINGIZE(__clang_major__) " (__cplusplus=" BOOST_SPIRIT_X3_STRINGIZE(__cplusplus) ")"
  30. # else
  31. # pragma message "This compiler seems to be GCC " BOOST_SPIRIT_X3_STRINGIZE(__GNUC__) " (__cplusplus=" BOOST_SPIRIT_X3_STRINGIZE(__cplusplus) ")"
  32. # endif
  33. # warning "Define BOOST_SPIRIT_X3_HIDE_CXX17_WARNING to hide the warning"
  34. # elif defined _MSC_VER
  35. # pragma message (__FILE__ "(" BOOST_SPIRIT_X3_STRINGIZE(__LINE__) "): warning: Spirit X3 will soon use C++17 features which your compiler does not support" )
  36. # ifdef _MSVC_LANG
  37. # if _MSC_VER >= 1915 && _MSVC_LANG < 201703L
  38. # pragma message (__FILE__ "(" BOOST_SPIRIT_X3_STRINGIZE(__LINE__) "): warning: Use /std:c++17 compiler flag to enable C++17 mode" )
  39. # endif
  40. # define BOOST_SPIRIT_X3_TMP "_MSVC_LANG=" BOOST_SPIRIT_X3_STRINGIZE(_MSVC_LANG)
  41. # elif defined _HAS_CXX17
  42. # define BOOST_SPIRIT_X3_TMP "_HAS_CXX17 defined"
  43. # else
  44. # define BOOST_SPIRIT_X3_TMP "__cplusplus=" BOOST_SPIRIT_X3_STRINGIZE(__cplusplus)
  45. # endif
  46. # pragma message (__FILE__ "(" BOOST_SPIRIT_X3_STRINGIZE(__LINE__) "): warning: Minimal supported compiler versions: Clang 4 / GCC 7 / MSC 1915 (VS 2017 v15.8)" )
  47. # pragma message (__FILE__ "(" BOOST_SPIRIT_X3_STRINGIZE(__LINE__) "): warning: This compiler seems to be MSC " BOOST_SPIRIT_X3_STRINGIZE(_MSC_VER) " (" BOOST_SPIRIT_X3_TMP ")" )
  48. # undef BOOST_SPIRIT_X3_TMP
  49. # pragma message (__FILE__ "(" BOOST_SPIRIT_X3_STRINGIZE(__LINE__) "): warning: Define BOOST_SPIRIT_X3_HIDE_CXX17_WARNING to hide the warning" )
  50. # else
  51. # pragma message "warning: Spirit X3 will soon use C++17 features which your compiler does not support"
  52. # pragma message "warning: Minimal supported compiler versions: Clang 4 / GCC 7 / MSC 1915 (VS 2017 v15.8)"
  53. # pragma message "warning: Define BOOST_SPIRIT_X3_HIDE_CXX17_WARNING to hide the warning"
  54. # endif
  55. # undef BOOST_SPIRIT_X3_STRINGIZE
  56. # undef BOOST_SPIRIT_X3_STRINGIZE_IMPL
  57. #endif
  58. #include <boost/spirit/home/x3/auxiliary.hpp>
  59. #include <boost/spirit/home/x3/char.hpp>
  60. #include <boost/spirit/home/x3/directive.hpp>
  61. #include <boost/spirit/home/x3/nonterminal.hpp>
  62. #include <boost/spirit/home/x3/numeric.hpp>
  63. #include <boost/spirit/home/x3/operator.hpp>
  64. #include <boost/spirit/home/x3/core.hpp>
  65. #include <boost/spirit/home/x3/string.hpp>
  66. #endif