blob: 308426fed99cd31e6c16ac948b5efc29fa204ee5 [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001# /* **************************************************************************
2# * *
3# * (C) Copyright Paul Mensonides 2002.
4# * Distributed under the Boost Software License, Version 1.0. (See
5# * accompanying file LICENSE_1_0.txt or copy at
6# * http://www.boost.org/LICENSE_1_0.txt)
7# * *
8# ************************************************************************** */
9#
10# /* See http://www.boost.org for most recent version. */
11#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070012# ifndef NDNBOOST_PREPROCESSOR_REPETITION_ENUM_BINARY_PARAMS_HPP
13# define NDNBOOST_PREPROCESSOR_REPETITION_ENUM_BINARY_PARAMS_HPP
Jeff Thompsona28eed82013-08-22 16:21:10 -070014#
15# include <ndnboost/preprocessor/cat.hpp>
16# include <ndnboost/preprocessor/config/config.hpp>
17# include <ndnboost/preprocessor/punctuation/comma_if.hpp>
18# include <ndnboost/preprocessor/repetition/repeat.hpp>
19# include <ndnboost/preprocessor/tuple/elem.hpp>
20# include <ndnboost/preprocessor/tuple/rem.hpp>
21#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070022# /* NDNBOOST_PP_ENUM_BINARY_PARAMS */
Jeff Thompsona28eed82013-08-22 16:21:10 -070023#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070024# if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG()
25# define NDNBOOST_PP_ENUM_BINARY_PARAMS(count, p1, p2) NDNBOOST_PP_REPEAT(count, NDNBOOST_PP_ENUM_BINARY_PARAMS_M, (p1, p2))
Jeff Thompsona28eed82013-08-22 16:21:10 -070026# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070027# define NDNBOOST_PP_ENUM_BINARY_PARAMS(count, p1, p2) NDNBOOST_PP_ENUM_BINARY_PARAMS_I(count, p1, p2)
28# define NDNBOOST_PP_ENUM_BINARY_PARAMS_I(count, p1, p2) NDNBOOST_PP_REPEAT(count, NDNBOOST_PP_ENUM_BINARY_PARAMS_M, (p1, p2))
Jeff Thompsona28eed82013-08-22 16:21:10 -070029# endif
30#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070031# if NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_STRICT()
32# define NDNBOOST_PP_ENUM_BINARY_PARAMS_M(z, n, pp) NDNBOOST_PP_ENUM_BINARY_PARAMS_M_IM(z, n, NDNBOOST_PP_TUPLE_REM_2 pp)
33# define NDNBOOST_PP_ENUM_BINARY_PARAMS_M_IM(z, n, im) NDNBOOST_PP_ENUM_BINARY_PARAMS_M_I(z, n, im)
Jeff Thompsona28eed82013-08-22 16:21:10 -070034# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070035# define NDNBOOST_PP_ENUM_BINARY_PARAMS_M(z, n, pp) NDNBOOST_PP_ENUM_BINARY_PARAMS_M_I(z, n, NDNBOOST_PP_TUPLE_ELEM(2, 0, pp), NDNBOOST_PP_TUPLE_ELEM(2, 1, pp))
Jeff Thompsona28eed82013-08-22 16:21:10 -070036# endif
37#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070038# if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_MSVC()
39# define NDNBOOST_PP_ENUM_BINARY_PARAMS_M_I(z, n, p1, p2) NDNBOOST_PP_ENUM_BINARY_PARAMS_M_II(z, n, p1, p2)
40# define NDNBOOST_PP_ENUM_BINARY_PARAMS_M_II(z, n, p1, p2) NDNBOOST_PP_COMMA_IF(n) p1 ## n p2 ## n
Jeff Thompsona28eed82013-08-22 16:21:10 -070041# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070042# define NDNBOOST_PP_ENUM_BINARY_PARAMS_M_I(z, n, p1, p2) NDNBOOST_PP_COMMA_IF(n) NDNBOOST_PP_CAT(p1, n) NDNBOOST_PP_CAT(p2, n)
Jeff Thompsona28eed82013-08-22 16:21:10 -070043# endif
44#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070045# /* NDNBOOST_PP_ENUM_BINARY_PARAMS_Z */
Jeff Thompsona28eed82013-08-22 16:21:10 -070046#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070047# if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG()
48# define NDNBOOST_PP_ENUM_BINARY_PARAMS_Z(z, count, p1, p2) NDNBOOST_PP_REPEAT_ ## z(count, NDNBOOST_PP_ENUM_BINARY_PARAMS_M, (p1, p2))
Jeff Thompsona28eed82013-08-22 16:21:10 -070049# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070050# define NDNBOOST_PP_ENUM_BINARY_PARAMS_Z(z, count, p1, p2) NDNBOOST_PP_ENUM_BINARY_PARAMS_Z_I(z, count, p1, p2)
51# define NDNBOOST_PP_ENUM_BINARY_PARAMS_Z_I(z, count, p1, p2) NDNBOOST_PP_REPEAT_ ## z(count, NDNBOOST_PP_ENUM_BINARY_PARAMS_M, (p1, p2))
Jeff Thompsona28eed82013-08-22 16:21:10 -070052# endif
53#
54# endif