blob: fb6c523e3b0644f4968e48aae6ccc3948df2d542 [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_TRAILING_HPP
13# define NDNBOOST_PREPROCESSOR_REPETITION_ENUM_TRAILING_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/debug/error.hpp>
18# include <ndnboost/preprocessor/detail/auto_rec.hpp>
19# include <ndnboost/preprocessor/repetition/repeat.hpp>
20# include <ndnboost/preprocessor/tuple/elem.hpp>
21# include <ndnboost/preprocessor/tuple/rem.hpp>
22#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070023# /* NDNBOOST_PP_ENUM_TRAILING */
Jeff Thompsona28eed82013-08-22 16:21:10 -070024#
25# if 0
Jeff Thompson3d613fd2013-10-15 15:39:04 -070026# define NDNBOOST_PP_ENUM_TRAILING(count, macro, data)
Jeff Thompsona28eed82013-08-22 16:21:10 -070027# endif
28#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070029# define NDNBOOST_PP_ENUM_TRAILING NDNBOOST_PP_CAT(NDNBOOST_PP_ENUM_TRAILING_, NDNBOOST_PP_AUTO_REC(NDNBOOST_PP_REPEAT_P, 4))
Jeff Thompsona28eed82013-08-22 16:21:10 -070030#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070031# if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG()
32# define NDNBOOST_PP_ENUM_TRAILING_1(c, m, d) NDNBOOST_PP_REPEAT_1(c, NDNBOOST_PP_ENUM_TRAILING_M_1, (m, d))
33# define NDNBOOST_PP_ENUM_TRAILING_2(c, m, d) NDNBOOST_PP_REPEAT_2(c, NDNBOOST_PP_ENUM_TRAILING_M_2, (m, d))
34# define NDNBOOST_PP_ENUM_TRAILING_3(c, m, d) NDNBOOST_PP_REPEAT_3(c, NDNBOOST_PP_ENUM_TRAILING_M_3, (m, d))
Jeff Thompsona28eed82013-08-22 16:21:10 -070035# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070036# define NDNBOOST_PP_ENUM_TRAILING_1(c, m, d) NDNBOOST_PP_ENUM_TRAILING_1_I(c, m, d)
37# define NDNBOOST_PP_ENUM_TRAILING_2(c, m, d) NDNBOOST_PP_ENUM_TRAILING_2_I(c, m, d)
38# define NDNBOOST_PP_ENUM_TRAILING_3(c, m, d) NDNBOOST_PP_ENUM_TRAILING_3_I(c, m, d)
39# define NDNBOOST_PP_ENUM_TRAILING_1_I(c, m, d) NDNBOOST_PP_REPEAT_1(c, NDNBOOST_PP_ENUM_TRAILING_M_1, (m, d))
40# define NDNBOOST_PP_ENUM_TRAILING_2_I(c, m, d) NDNBOOST_PP_REPEAT_2(c, NDNBOOST_PP_ENUM_TRAILING_M_2, (m, d))
41# define NDNBOOST_PP_ENUM_TRAILING_3_I(c, m, d) NDNBOOST_PP_REPEAT_3(c, NDNBOOST_PP_ENUM_TRAILING_M_3, (m, d))
Jeff Thompsona28eed82013-08-22 16:21:10 -070042# endif
43#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070044# define NDNBOOST_PP_ENUM_TRAILING_4(c, m, d) NDNBOOST_PP_ERROR(0x0003)
Jeff Thompsona28eed82013-08-22 16:21:10 -070045#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070046# if NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_STRICT()
47# define NDNBOOST_PP_ENUM_TRAILING_M_1(z, n, md) NDNBOOST_PP_ENUM_TRAILING_M_1_IM(z, n, NDNBOOST_PP_TUPLE_REM_2 md)
48# define NDNBOOST_PP_ENUM_TRAILING_M_2(z, n, md) NDNBOOST_PP_ENUM_TRAILING_M_2_IM(z, n, NDNBOOST_PP_TUPLE_REM_2 md)
49# define NDNBOOST_PP_ENUM_TRAILING_M_3(z, n, md) NDNBOOST_PP_ENUM_TRAILING_M_3_IM(z, n, NDNBOOST_PP_TUPLE_REM_2 md)
50# define NDNBOOST_PP_ENUM_TRAILING_M_1_IM(z, n, im) NDNBOOST_PP_ENUM_TRAILING_M_1_I(z, n, im)
51# define NDNBOOST_PP_ENUM_TRAILING_M_2_IM(z, n, im) NDNBOOST_PP_ENUM_TRAILING_M_2_I(z, n, im)
52# define NDNBOOST_PP_ENUM_TRAILING_M_3_IM(z, n, im) NDNBOOST_PP_ENUM_TRAILING_M_3_I(z, n, im)
Jeff Thompsona28eed82013-08-22 16:21:10 -070053# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070054# define NDNBOOST_PP_ENUM_TRAILING_M_1(z, n, md) NDNBOOST_PP_ENUM_TRAILING_M_1_I(z, n, NDNBOOST_PP_TUPLE_ELEM(2, 0, md), NDNBOOST_PP_TUPLE_ELEM(2, 1, md))
55# define NDNBOOST_PP_ENUM_TRAILING_M_2(z, n, md) NDNBOOST_PP_ENUM_TRAILING_M_2_I(z, n, NDNBOOST_PP_TUPLE_ELEM(2, 0, md), NDNBOOST_PP_TUPLE_ELEM(2, 1, md))
56# define NDNBOOST_PP_ENUM_TRAILING_M_3(z, n, md) NDNBOOST_PP_ENUM_TRAILING_M_3_I(z, n, NDNBOOST_PP_TUPLE_ELEM(2, 0, md), NDNBOOST_PP_TUPLE_ELEM(2, 1, md))
Jeff Thompsona28eed82013-08-22 16:21:10 -070057# endif
58#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070059# define NDNBOOST_PP_ENUM_TRAILING_M_1_I(z, n, m, d) , m(z, n, d)
60# define NDNBOOST_PP_ENUM_TRAILING_M_2_I(z, n, m, d) , m(z, n, d)
61# define NDNBOOST_PP_ENUM_TRAILING_M_3_I(z, n, m, d) , m(z, n, d)
Jeff Thompsona28eed82013-08-22 16:21:10 -070062#
63# endif