Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 1 | # /* Copyright (C) 2001 |
| 2 | # * Housemarque Oy |
| 3 | # * http://www.housemarque.com |
| 4 | # * |
| 5 | # * Distributed under the Boost Software License, Version 1.0. (See |
| 6 | # * accompanying file LICENSE_1_0.txt or copy at |
| 7 | # * http://www.boost.org/LICENSE_1_0.txt) |
| 8 | # */ |
| 9 | # |
| 10 | # /* Revised by Paul Mensonides (2002) */ |
| 11 | # |
| 12 | # /* See http://www.boost.org for most recent version. */ |
| 13 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 14 | # ifndef NDNBOOST_PREPROCESSOR_LIST_LIST_FOR_EACH_I_HPP |
| 15 | # define NDNBOOST_PREPROCESSOR_LIST_LIST_FOR_EACH_I_HPP |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 16 | # |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 17 | # include <ndnboost/preprocessor/arithmetic/inc.hpp> |
| 18 | # include <ndnboost/preprocessor/config/config.hpp> |
| 19 | # include <ndnboost/preprocessor/list/adt.hpp> |
| 20 | # include <ndnboost/preprocessor/repetition/for.hpp> |
| 21 | # include <ndnboost/preprocessor/tuple/elem.hpp> |
| 22 | # include <ndnboost/preprocessor/tuple/rem.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 23 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 24 | # /* NDNBOOST_PP_LIST_FOR_EACH_I */ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 25 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 26 | # if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG() && ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_MSVC() |
| 27 | # define NDNBOOST_PP_LIST_FOR_EACH_I(macro, data, list) NDNBOOST_PP_FOR((macro, data, list, 0), NDNBOOST_PP_LIST_FOR_EACH_I_P, NDNBOOST_PP_LIST_FOR_EACH_I_O, NDNBOOST_PP_LIST_FOR_EACH_I_M) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 28 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 29 | # define NDNBOOST_PP_LIST_FOR_EACH_I(macro, data, list) NDNBOOST_PP_LIST_FOR_EACH_I_I(macro, data, list) |
| 30 | # define NDNBOOST_PP_LIST_FOR_EACH_I_I(macro, data, list) NDNBOOST_PP_FOR((macro, data, list, 0), NDNBOOST_PP_LIST_FOR_EACH_I_P, NDNBOOST_PP_LIST_FOR_EACH_I_O, NDNBOOST_PP_LIST_FOR_EACH_I_M) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 31 | # endif |
| 32 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 33 | # if NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_STRICT() |
| 34 | # define NDNBOOST_PP_LIST_FOR_EACH_I_P(r, x) NDNBOOST_PP_LIST_FOR_EACH_I_P_D x |
| 35 | # define NDNBOOST_PP_LIST_FOR_EACH_I_P_D(m, d, l, i) NDNBOOST_PP_LIST_IS_CONS(l) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 36 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 37 | # define NDNBOOST_PP_LIST_FOR_EACH_I_P(r, x) NDNBOOST_PP_LIST_IS_CONS(NDNBOOST_PP_TUPLE_ELEM(4, 2, x)) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 38 | # endif |
| 39 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 40 | # if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_MWCC() |
| 41 | # define NDNBOOST_PP_LIST_FOR_EACH_I_O(r, x) NDNBOOST_PP_LIST_FOR_EACH_I_O_D x |
| 42 | # define NDNBOOST_PP_LIST_FOR_EACH_I_O_D(m, d, l, i) (m, d, NDNBOOST_PP_LIST_REST(l), NDNBOOST_PP_INC(i)) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 43 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 44 | # define NDNBOOST_PP_LIST_FOR_EACH_I_O(r, x) (NDNBOOST_PP_TUPLE_ELEM(4, 0, x), NDNBOOST_PP_TUPLE_ELEM(4, 1, x), NDNBOOST_PP_LIST_REST(NDNBOOST_PP_TUPLE_ELEM(4, 2, x)), NDNBOOST_PP_INC(NDNBOOST_PP_TUPLE_ELEM(4, 3, x))) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 45 | # endif |
| 46 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 47 | # if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG() |
| 48 | # define NDNBOOST_PP_LIST_FOR_EACH_I_M(r, x) NDNBOOST_PP_LIST_FOR_EACH_I_M_D(r, NDNBOOST_PP_TUPLE_ELEM(4, 0, x), NDNBOOST_PP_TUPLE_ELEM(4, 1, x), NDNBOOST_PP_TUPLE_ELEM(4, 2, x), NDNBOOST_PP_TUPLE_ELEM(4, 3, x)) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 49 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 50 | # define NDNBOOST_PP_LIST_FOR_EACH_I_M(r, x) NDNBOOST_PP_LIST_FOR_EACH_I_M_I(r, NDNBOOST_PP_TUPLE_REM_4 x) |
| 51 | # define NDNBOOST_PP_LIST_FOR_EACH_I_M_I(r, x_e) NDNBOOST_PP_LIST_FOR_EACH_I_M_D(r, x_e) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 52 | # endif |
| 53 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 54 | # define NDNBOOST_PP_LIST_FOR_EACH_I_M_D(r, m, d, l, i) m(r, d, i, NDNBOOST_PP_LIST_FIRST(l)) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 55 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 56 | # /* NDNBOOST_PP_LIST_FOR_EACH_I_R */ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 57 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 58 | # if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG() |
| 59 | # define NDNBOOST_PP_LIST_FOR_EACH_I_R(r, macro, data, list) NDNBOOST_PP_FOR_ ## r((macro, data, list, 0), NDNBOOST_PP_LIST_FOR_EACH_I_P, NDNBOOST_PP_LIST_FOR_EACH_I_O, NDNBOOST_PP_LIST_FOR_EACH_I_M) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 60 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 61 | # define NDNBOOST_PP_LIST_FOR_EACH_I_R(r, macro, data, list) NDNBOOST_PP_LIST_FOR_EACH_I_R_I(r, macro, data, list) |
| 62 | # define NDNBOOST_PP_LIST_FOR_EACH_I_R_I(r, macro, data, list) NDNBOOST_PP_FOR_ ## r((macro, data, list, 0), NDNBOOST_PP_LIST_FOR_EACH_I_P, NDNBOOST_PP_LIST_FOR_EACH_I_O, NDNBOOST_PP_LIST_FOR_EACH_I_M) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 63 | # endif |
| 64 | # |
| 65 | # endif |