blob: b0ea43e01e18ccfb3d54d12a083c10e9441a8deb [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001# /* 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 Thompson3d613fd2013-10-15 15:39:04 -070014# ifndef NDNBOOST_PREPROCESSOR_LIST_LIST_FOR_EACH_I_HPP
15# define NDNBOOST_PREPROCESSOR_LIST_LIST_FOR_EACH_I_HPP
Jeff Thompsonf7d49942013-08-01 16:47:40 -070016#
Jeff Thompson2277ce52013-08-01 17:34:11 -070017# 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 Thompsonf7d49942013-08-01 16:47:40 -070023#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070024# /* NDNBOOST_PP_LIST_FOR_EACH_I */
Jeff Thompsonf7d49942013-08-01 16:47:40 -070025#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070026# 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 Thompsonf7d49942013-08-01 16:47:40 -070028# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070029# 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 Thompsonf7d49942013-08-01 16:47:40 -070031# endif
32#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070033# 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 Thompsonf7d49942013-08-01 16:47:40 -070036# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070037# define NDNBOOST_PP_LIST_FOR_EACH_I_P(r, x) NDNBOOST_PP_LIST_IS_CONS(NDNBOOST_PP_TUPLE_ELEM(4, 2, x))
Jeff Thompsonf7d49942013-08-01 16:47:40 -070038# endif
39#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070040# 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 Thompsonf7d49942013-08-01 16:47:40 -070043# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070044# 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 Thompsonf7d49942013-08-01 16:47:40 -070045# endif
46#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070047# 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 Thompsonf7d49942013-08-01 16:47:40 -070049# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070050# 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 Thompsonf7d49942013-08-01 16:47:40 -070052# endif
53#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070054# define NDNBOOST_PP_LIST_FOR_EACH_I_M_D(r, m, d, l, i) m(r, d, i, NDNBOOST_PP_LIST_FIRST(l))
Jeff Thompsonf7d49942013-08-01 16:47:40 -070055#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070056# /* NDNBOOST_PP_LIST_FOR_EACH_I_R */
Jeff Thompsonf7d49942013-08-01 16:47:40 -070057#
Jeff Thompson3d613fd2013-10-15 15:39:04 -070058# 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 Thompsonf7d49942013-08-01 16:47:40 -070060# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070061# 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 Thompsonf7d49942013-08-01 16:47:40 -070063# endif
64#
65# endif