limits.hpp 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*=============================================================================
  2. Copyright (c) 2001-2007 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. #ifndef BOOST_PHOENIX_CORE_LIMITS_HPP
  7. #define BOOST_PHOENIX_CORE_LIMITS_HPP
  8. #include <boost/preprocessor/arithmetic/add.hpp>
  9. #include <boost/preprocessor/inc.hpp>
  10. #include <boost/preprocessor/dec.hpp>
  11. #include <boost/preprocessor/stringize.hpp>
  12. #include <boost/phoenix/version.hpp>
  13. #include <boost/phoenix/support/preprocessor/round.hpp>
  14. #if defined(BOOST_PHOENIX_LIMIT)
  15. #define BOOST_PROTO_MAX_ARITY BOOST_PHOENIX_LIMIT
  16. #include <boost/proto/proto_fwd.hpp>
  17. #else
  18. #include <boost/proto/proto_fwd.hpp>
  19. #define BOOST_PHOENIX_LIMIT BOOST_PROTO_MAX_ARITY
  20. #endif
  21. #define PHOENIX_LIMIT BOOST_PHOENIX_LIMIT
  22. #define BOOST_PHOENIX_LIMIT_STR BOOST_PP_STRINGIZE(BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT))
  23. #if !defined(BOOST_PHOENIX_ARG_LIMIT)
  24. # define BOOST_PHOENIX_ARG_LIMIT BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT)
  25. #elif (BOOST_PHOENIX_ARG_LIMIT < 5)
  26. # error "BOOST_PHOENIX_ARG_LIMIT is set too low"
  27. #elif BOOST_PHOENIX_ARG_LIMIT != BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT) && !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  28. # define BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
  29. #endif
  30. #if !defined(BOOST_PHOENIX_ACTOR_LIMIT)
  31. # define BOOST_PHOENIX_ACTOR_LIMIT BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT)
  32. #elif (BOOST_PHOENIX_ACTOR_LIMIT > BOOST_PHOENIX_ARG_LIMIT)
  33. # error "BOOST_PHOENIX_ACTOR_LIMIT > BOOST_PHOENIX_ARG_LIMIT"
  34. #elif (BOOST_PHOENIX_ACTOR_LIMIT < 3)
  35. # error "BOOST_PHOENIX_ACTOR_LIMIT is set too low"
  36. #elif BOOST_PHOENIX_ACTOR_LIMIT != BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT) && !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  37. # define BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
  38. #endif
  39. #if !defined(BOOST_PHOENIX_PERFECT_FORWARD_LIMIT)
  40. # define BOOST_PHOENIX_PERFECT_FORWARD_LIMIT 3
  41. #elif (BOOST_PHOENIX_PERFECT_FORWARD_LIMIT > BOOST_PHOENIX_ACTOR_LIMIT)
  42. # error "BOOST_PHOENIX_PERFECT_FORWARD_LIMIT > BOOST_PHOENIX_ACTOR_LIMIT"
  43. #elif (BOOST_PHOENIX_PERFECT_FORWARD_LIMIT < 3)
  44. # error "BOOST_PHOENIX_PERFECT_FORWARD_LIMIT is set too low"
  45. #elif BOOST_PHOENIX_PERFECT_FORWARD_LIMIT != 3 && !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  46. # define BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
  47. #endif
  48. #if !defined(BOOST_PHOENIX_COMPOSITE_LIMIT)
  49. # define BOOST_PHOENIX_COMPOSITE_LIMIT BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT)
  50. #elif (BOOST_PHOENIX_COMPOSITE_LIMIT < 5)
  51. # error "BOOST_PHOENIX_COMPOSITE_LIMIT is set too low"
  52. #elif BOOST_PHOENIX_COMPOSITE_LIMIT != BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT) && !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  53. # define BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
  54. #endif
  55. #if !defined(BOOST_PHOENIX_MEMBER_LIMIT)
  56. # define BOOST_PHOENIX_MEMBER_LIMIT BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT)
  57. #elif (BOOST_PHOENIX_MEMBER_LIMIT > BOOST_PHOENIX_COMPOSITE_LIMIT)
  58. # error "BOOST_PHOENIX_MEMBER_LIMIT > BOOST_PHOENIX_COMPOSITE_LIMIT"
  59. #elif (BOOST_PHOENIX_MEMBER_LIMIT < 3)
  60. # error "BOOST_PHOENIX_MEMBER_LIMIT is set too low"
  61. #elif BOOST_PHOENIX_MEMBER_LIMIT != BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT) && !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  62. # define BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
  63. #endif
  64. #if !defined(BOOST_PHOENIX_CATCH_LIMIT)
  65. # define BOOST_PHOENIX_CATCH_LIMIT BOOST_PHOENIX_COMPOSITE_LIMIT
  66. #elif (BOOST_PHOENIX_CATCH_LIMIT < 1)
  67. # error "BOOST_PHOENIX_CATCH_LIMIT is set too low"
  68. #elif BOOST_PHOENIX_CATCH_LIMIT != BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT) && !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  69. # define BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
  70. #endif
  71. #if !defined(BOOST_PHOENIX_DYNAMIC_LIMIT)
  72. # define BOOST_PHOENIX_DYNAMIC_LIMIT BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT)
  73. #elif (BOOST_PHOENIX_DYNAMIC_LIMIT < 1)
  74. # error "BOOST_PHOENIX_DYNAMIC_LIMIT is set too low"
  75. #elif BOOST_PHOENIX_DYNAMIC_LIMIT != BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT) && !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  76. # define BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
  77. #endif
  78. #if !defined(BOOST_PHOENIX_LOCAL_LIMIT)
  79. # define BOOST_PHOENIX_LOCAL_LIMIT BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT)
  80. #elif (BOOST_PHOENIX_LOCAL_LIMIT < 3)
  81. # error "BOOST_PHOENIX_LOCAL_LIMIT is set too low"
  82. #elif BOOST_PHOENIX_LOCAL_LIMIT != BOOST_PHOENIX_PP_ROUND_UP(BOOST_PHOENIX_LIMIT) && !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  83. # define BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
  84. #endif
  85. #endif