Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | # /* ************************************************************************** |
| 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 Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 12 | # ifndef NDNBOOST_PREPROCESSOR_REPETITION_ENUM_TRAILING_HPP |
| 13 | # define NDNBOOST_PREPROCESSOR_REPETITION_ENUM_TRAILING_HPP |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 14 | # |
| 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 Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 23 | # /* NDNBOOST_PP_ENUM_TRAILING */ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 24 | # |
| 25 | # if 0 |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 26 | # define NDNBOOST_PP_ENUM_TRAILING(count, macro, data) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 27 | # endif |
| 28 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 29 | # define NDNBOOST_PP_ENUM_TRAILING NDNBOOST_PP_CAT(NDNBOOST_PP_ENUM_TRAILING_, NDNBOOST_PP_AUTO_REC(NDNBOOST_PP_REPEAT_P, 4)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 30 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 31 | # 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 Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 35 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 36 | # 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 Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 42 | # endif |
| 43 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 44 | # define NDNBOOST_PP_ENUM_TRAILING_4(c, m, d) NDNBOOST_PP_ERROR(0x0003) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 45 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 46 | # 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 Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 53 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 54 | # 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 Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 57 | # endif |
| 58 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 59 | # 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 Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 62 | # |
| 63 | # endif |