MessagePack for C++
for_each_i.hpp
Go to the documentation of this file.
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 #
14 # ifndef MSGPACK_PREPROCESSOR_LIST_LIST_FOR_EACH_I_HPP
15 # define MSGPACK_PREPROCESSOR_LIST_LIST_FOR_EACH_I_HPP
16 #
23 #
24 # /* MSGPACK_PP_LIST_FOR_EACH_I */
25 #
26 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG() && ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MSVC()
27 # define MSGPACK_PP_LIST_FOR_EACH_I(macro, data, list) MSGPACK_PP_FOR((macro, data, list, 0), MSGPACK_PP_LIST_FOR_EACH_I_P, MSGPACK_PP_LIST_FOR_EACH_I_O, MSGPACK_PP_LIST_FOR_EACH_I_M)
28 # else
29 # define MSGPACK_PP_LIST_FOR_EACH_I(macro, data, list) MSGPACK_PP_LIST_FOR_EACH_I_I(macro, data, list)
30 # define MSGPACK_PP_LIST_FOR_EACH_I_I(macro, data, list) MSGPACK_PP_FOR((macro, data, list, 0), MSGPACK_PP_LIST_FOR_EACH_I_P, MSGPACK_PP_LIST_FOR_EACH_I_O, MSGPACK_PP_LIST_FOR_EACH_I_M)
31 # endif
32 #
33 # if MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_STRICT()
34 # define MSGPACK_PP_LIST_FOR_EACH_I_P(r, x) MSGPACK_PP_LIST_FOR_EACH_I_P_D x
35 # define MSGPACK_PP_LIST_FOR_EACH_I_P_D(m, d, l, i) MSGPACK_PP_LIST_IS_CONS(l)
36 # else
37 # define MSGPACK_PP_LIST_FOR_EACH_I_P(r, x) MSGPACK_PP_LIST_IS_CONS(MSGPACK_PP_TUPLE_ELEM(4, 2, x))
38 # endif
39 #
40 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MWCC()
41 # define MSGPACK_PP_LIST_FOR_EACH_I_O(r, x) MSGPACK_PP_LIST_FOR_EACH_I_O_D x
42 # define MSGPACK_PP_LIST_FOR_EACH_I_O_D(m, d, l, i) (m, d, MSGPACK_PP_LIST_REST(l), MSGPACK_PP_INC(i))
43 # else
44 # define MSGPACK_PP_LIST_FOR_EACH_I_O(r, x) (MSGPACK_PP_TUPLE_ELEM(4, 0, x), MSGPACK_PP_TUPLE_ELEM(4, 1, x), MSGPACK_PP_LIST_REST(MSGPACK_PP_TUPLE_ELEM(4, 2, x)), MSGPACK_PP_INC(MSGPACK_PP_TUPLE_ELEM(4, 3, x)))
45 # endif
46 #
47 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
48 # define MSGPACK_PP_LIST_FOR_EACH_I_M(r, x) MSGPACK_PP_LIST_FOR_EACH_I_M_D(r, MSGPACK_PP_TUPLE_ELEM(4, 0, x), MSGPACK_PP_TUPLE_ELEM(4, 1, x), MSGPACK_PP_TUPLE_ELEM(4, 2, x), MSGPACK_PP_TUPLE_ELEM(4, 3, x))
49 # else
50 # define MSGPACK_PP_LIST_FOR_EACH_I_M(r, x) MSGPACK_PP_LIST_FOR_EACH_I_M_I(r, MSGPACK_PP_TUPLE_REM_4 x)
51 # define MSGPACK_PP_LIST_FOR_EACH_I_M_I(r, x_e) MSGPACK_PP_LIST_FOR_EACH_I_M_D(r, x_e)
52 # endif
53 #
54 # define MSGPACK_PP_LIST_FOR_EACH_I_M_D(r, m, d, l, i) m(r, d, i, MSGPACK_PP_LIST_FIRST(l))
55 #
56 # /* MSGPACK_PP_LIST_FOR_EACH_I_R */
57 #
58 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
59 # define MSGPACK_PP_LIST_FOR_EACH_I_R(r, macro, data, list) MSGPACK_PP_FOR_ ## r((macro, data, list, 0), MSGPACK_PP_LIST_FOR_EACH_I_P, MSGPACK_PP_LIST_FOR_EACH_I_O, MSGPACK_PP_LIST_FOR_EACH_I_M)
60 # else
61 # define MSGPACK_PP_LIST_FOR_EACH_I_R(r, macro, data, list) MSGPACK_PP_LIST_FOR_EACH_I_R_I(r, macro, data, list)
62 # define MSGPACK_PP_LIST_FOR_EACH_I_R_I(r, macro, data, list) MSGPACK_PP_FOR_ ## r((macro, data, list, 0), MSGPACK_PP_LIST_FOR_EACH_I_P, MSGPACK_PP_LIST_FOR_EACH_I_O, MSGPACK_PP_LIST_FOR_EACH_I_M)
63 # endif
64 #
65 # endif