142 lines
6.9 KiB
C++
142 lines
6.9 KiB
C++
/*=============================================================================
|
|
Copyright (c) 2001-2007 Joel de Guzman
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
==============================================================================*/
|
|
#ifndef ACTIV_BOOST_PHOENIX_CORE_LIMITS_HPP
|
|
#define ACTIV_BOOST_PHOENIX_CORE_LIMITS_HPP
|
|
|
|
#include <ActivBoost/config.hpp>
|
|
#include <ActivBoost/detail/workaround.hpp>
|
|
#include <ActivBoost/preprocessor/arithmetic/add.hpp>
|
|
#include <ActivBoost/preprocessor/inc.hpp>
|
|
#include <ActivBoost/preprocessor/dec.hpp>
|
|
#include <ActivBoost/preprocessor/stringize.hpp>
|
|
#include <ActivBoost/phoenix/version.hpp>
|
|
#include <ActivBoost/phoenix/support/preprocessor/round.hpp>
|
|
|
|
|
|
#if defined(ACTIV_BOOST_PHOENIX_USER_LIMIT)
|
|
# if !defined( ACTIV_BOOST_PROTO_MAX_ARITY )
|
|
# define ACTIV_BOOST_PROTO_MAX_ARITY ACTIV_BOOST_PHOENIX_USER_LIMIT
|
|
# elif (ACTIV_BOOST_PROTO_MAX_ARITY < ACTIV_BOOST_PHOENIX_USER_LIMIT)
|
|
# error "ACTIV_BOOST_PROTO_MAX_ARITY is set too low"
|
|
# endif
|
|
#include <ActivBoost/proto/proto_fwd.hpp>
|
|
#else
|
|
#include <ActivBoost/proto/proto_fwd.hpp>
|
|
#define ACTIV_BOOST_PHOENIX_USER_LIMIT ACTIV_BOOST_PROTO_MAX_ARITY
|
|
#endif
|
|
|
|
#if !defined(ACTIV_BOOST_PHOENIX_LIMIT)
|
|
#define ACTIV_BOOST_PHOENIX_LIMIT ACTIV_BOOST_PHOENIX_USER_LIMIT
|
|
#endif
|
|
|
|
#define ACTIV_BOOST_PHOENIX_USER_LIMIT_STR ACTIV_BOOST_PP_STRINGIZE(ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT))
|
|
|
|
#ifdef ACTIV_BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_ACTOR
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_CALL
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_FUNCTION_EQUAL
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_FUNCTION_EVAL
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_BIND
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_SCOPE
|
|
#endif
|
|
#ifdef ACTIV_BOOST_NO_CXX11_RVALUE_REFERENCES
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_ACTOR
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_FUNCTION_EVAL
|
|
#endif
|
|
|
|
#if ACTIV_BOOST_WORKAROUND(ACTIV_BOOST_MSVC, == 1800)
|
|
// FIXME: temporary disable on MSVC 2013.
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_SCOPE
|
|
#endif
|
|
|
|
#ifdef ACTIV_BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
|
|
// FIXME: Due to proto, some compilers cannot expand parameter pack.
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_ACTOR
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_CALL
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_FUNCTION_EVAL
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_BIND
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_SCOPE
|
|
#endif
|
|
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_OBJECT
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_OPERATOR
|
|
# define ACTIV_BOOST_PHOENIX_NO_VARIADIC_FUNCTION
|
|
|
|
#if !defined(ACTIV_BOOST_PHOENIX_ARG_LIMIT)
|
|
# define ACTIV_BOOST_PHOENIX_ARG_LIMIT ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT)
|
|
#elif (ACTIV_BOOST_PHOENIX_ARG_LIMIT < 5)
|
|
# error "ACTIV_BOOST_PHOENIX_ARG_LIMIT is set too low"
|
|
#elif ACTIV_BOOST_PHOENIX_ARG_LIMIT != ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT) && !defined(ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
|
# define ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
|
|
#endif
|
|
|
|
#if !defined(ACTIV_BOOST_PHOENIX_ACTOR_LIMIT)
|
|
# define ACTIV_BOOST_PHOENIX_ACTOR_LIMIT ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT)
|
|
#elif (ACTIV_BOOST_PHOENIX_ACTOR_LIMIT > ACTIV_BOOST_PHOENIX_ARG_LIMIT)
|
|
# error "ACTIV_BOOST_PHOENIX_ACTOR_LIMIT > ACTIV_BOOST_PHOENIX_ARG_LIMIT"
|
|
#elif (ACTIV_BOOST_PHOENIX_ACTOR_LIMIT < 3)
|
|
# error "ACTIV_BOOST_PHOENIX_ACTOR_LIMIT is set too low"
|
|
#elif ACTIV_BOOST_PHOENIX_ACTOR_LIMIT != ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT) && !defined(ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
|
# define ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
|
|
#endif
|
|
|
|
#if !defined(ACTIV_BOOST_PHOENIX_PERFECT_FORWARD_LIMIT)
|
|
# define ACTIV_BOOST_PHOENIX_PERFECT_FORWARD_LIMIT 3
|
|
#elif (ACTIV_BOOST_PHOENIX_PERFECT_FORWARD_LIMIT > ACTIV_BOOST_PHOENIX_ACTOR_LIMIT)
|
|
# error "ACTIV_BOOST_PHOENIX_PERFECT_FORWARD_LIMIT > ACTIV_BOOST_PHOENIX_ACTOR_LIMIT"
|
|
#elif (ACTIV_BOOST_PHOENIX_PERFECT_FORWARD_LIMIT < 3)
|
|
# error "ACTIV_BOOST_PHOENIX_PERFECT_FORWARD_LIMIT is set too low"
|
|
#elif ACTIV_BOOST_PHOENIX_PERFECT_FORWARD_LIMIT != 3 && !defined(ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
|
# define ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
|
|
#endif
|
|
|
|
#if !defined(ACTIV_BOOST_PHOENIX_COMPOSITE_LIMIT)
|
|
# define ACTIV_BOOST_PHOENIX_COMPOSITE_LIMIT ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT)
|
|
#elif (ACTIV_BOOST_PHOENIX_COMPOSITE_LIMIT < 5)
|
|
# error "ACTIV_BOOST_PHOENIX_COMPOSITE_LIMIT is set too low"
|
|
#elif ACTIV_BOOST_PHOENIX_COMPOSITE_LIMIT != ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT) && !defined(ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
|
# define ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
|
|
#endif
|
|
|
|
#if !defined(ACTIV_BOOST_PHOENIX_MEMBER_LIMIT)
|
|
# define ACTIV_BOOST_PHOENIX_MEMBER_LIMIT ACTIV_BOOST_PP_DEC(ACTIV_BOOST_PHOENIX_COMPOSITE_LIMIT)
|
|
#elif (ACTIV_BOOST_PHOENIX_MEMBER_LIMIT > ACTIV_BOOST_PHOENIX_COMPOSITE_LIMIT)
|
|
# error "ACTIV_BOOST_PHOENIX_MEMBER_LIMIT > ACTIV_BOOST_PHOENIX_COMPOSITE_LIMIT"
|
|
#elif (ACTIV_BOOST_PHOENIX_MEMBER_LIMIT < 3)
|
|
# error "ACTIV_BOOST_PHOENIX_MEMBER_LIMIT is set too low"
|
|
#elif ACTIV_BOOST_PHOENIX_MEMBER_LIMIT != ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT) && !defined(ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
|
# define ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
|
|
#endif
|
|
|
|
#if !defined(ACTIV_BOOST_PHOENIX_CATCH_LIMIT)
|
|
# define ACTIV_BOOST_PHOENIX_CATCH_LIMIT ACTIV_BOOST_PHOENIX_COMPOSITE_LIMIT
|
|
#elif (ACTIV_BOOST_PHOENIX_CATCH_LIMIT < 1)
|
|
# error "ACTIV_BOOST_PHOENIX_CATCH_LIMIT is set too low"
|
|
#elif ACTIV_BOOST_PHOENIX_CATCH_LIMIT != ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT) && !defined(ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
|
# define ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
|
|
#endif
|
|
|
|
#if !defined(ACTIV_BOOST_PHOENIX_DYNAMIC_LIMIT)
|
|
# define ACTIV_BOOST_PHOENIX_DYNAMIC_LIMIT ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT)
|
|
#elif (ACTIV_BOOST_PHOENIX_DYNAMIC_LIMIT < 1)
|
|
# error "ACTIV_BOOST_PHOENIX_DYNAMIC_LIMIT is set too low"
|
|
#elif ACTIV_BOOST_PHOENIX_DYNAMIC_LIMIT != ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT) && !defined(ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
|
# define ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
|
|
#endif
|
|
|
|
#if !defined(ACTIV_BOOST_PHOENIX_LOCAL_LIMIT)
|
|
# define ACTIV_BOOST_PHOENIX_LOCAL_LIMIT ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT)
|
|
#elif (ACTIV_BOOST_PHOENIX_LOCAL_LIMIT < 3)
|
|
# error "ACTIV_BOOST_PHOENIX_LOCAL_LIMIT is set too low"
|
|
#elif ACTIV_BOOST_PHOENIX_LOCAL_LIMIT != ACTIV_BOOST_PHOENIX_PP_ROUND_UP(ACTIV_BOOST_PHOENIX_USER_LIMIT) && !defined(ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
|
|
# define ACTIV_BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
|
|
#endif
|
|
|
|
#endif
|