MessagePack for C++
for_each_i.hpp
Go to the documentation of this file.
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 #
12 # ifndef MSGPACK_PREPROCESSOR_SEQ_FOR_EACH_I_HPP
13 # define MSGPACK_PREPROCESSOR_SEQ_FOR_EACH_I_HPP
14 #
23 #
24 # /* MSGPACK_PP_SEQ_FOR_EACH_I */
25 #
26 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
27 # define MSGPACK_PP_SEQ_FOR_EACH_I(macro, data, seq) MSGPACK_PP_FOR((macro, data, seq (nil), 0), MSGPACK_PP_SEQ_FOR_EACH_I_P, MSGPACK_PP_SEQ_FOR_EACH_I_O, MSGPACK_PP_SEQ_FOR_EACH_I_M)
28 # else
29 # define MSGPACK_PP_SEQ_FOR_EACH_I(macro, data, seq) MSGPACK_PP_SEQ_FOR_EACH_I_I(macro, data, seq)
30 # define MSGPACK_PP_SEQ_FOR_EACH_I_I(macro, data, seq) MSGPACK_PP_FOR((macro, data, seq (nil), 0), MSGPACK_PP_SEQ_FOR_EACH_I_P, MSGPACK_PP_SEQ_FOR_EACH_I_O, MSGPACK_PP_SEQ_FOR_EACH_I_M)
31 # endif
32 #
33 # define MSGPACK_PP_SEQ_FOR_EACH_I_P(r, x) MSGPACK_PP_DEC(MSGPACK_PP_SEQ_SIZE(MSGPACK_PP_TUPLE_ELEM(4, 2, x)))
34 #
35 # if MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_STRICT()
36 # define MSGPACK_PP_SEQ_FOR_EACH_I_O(r, x) MSGPACK_PP_SEQ_FOR_EACH_I_O_I x
37 # else
38 # define MSGPACK_PP_SEQ_FOR_EACH_I_O(r, x) MSGPACK_PP_SEQ_FOR_EACH_I_O_I(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))
39 # endif
40 #
41 # define MSGPACK_PP_SEQ_FOR_EACH_I_O_I(macro, data, seq, i) (macro, data, MSGPACK_PP_SEQ_TAIL(seq), MSGPACK_PP_INC(i))
42 #
43 # if MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_STRICT()
44 # define MSGPACK_PP_SEQ_FOR_EACH_I_M(r, x) MSGPACK_PP_SEQ_FOR_EACH_I_M_IM(r, MSGPACK_PP_TUPLE_REM_4 x)
45 # define MSGPACK_PP_SEQ_FOR_EACH_I_M_IM(r, im) MSGPACK_PP_SEQ_FOR_EACH_I_M_I(r, im)
46 # else
47 # define MSGPACK_PP_SEQ_FOR_EACH_I_M(r, x) MSGPACK_PP_SEQ_FOR_EACH_I_M_I(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))
48 # endif
49 #
50 # define MSGPACK_PP_SEQ_FOR_EACH_I_M_I(r, macro, data, seq, i) macro(r, data, i, MSGPACK_PP_SEQ_HEAD(seq))
51 #
52 # /* MSGPACK_PP_SEQ_FOR_EACH_I_R */
53 #
54 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
55 # define MSGPACK_PP_SEQ_FOR_EACH_I_R(r, macro, data, seq) MSGPACK_PP_FOR_ ## r((macro, data, seq (nil), 0), MSGPACK_PP_SEQ_FOR_EACH_I_P, MSGPACK_PP_SEQ_FOR_EACH_I_O, MSGPACK_PP_SEQ_FOR_EACH_I_M)
56 # else
57 # define MSGPACK_PP_SEQ_FOR_EACH_I_R(r, macro, data, seq) MSGPACK_PP_SEQ_FOR_EACH_I_R_I(r, macro, data, seq)
58 # define MSGPACK_PP_SEQ_FOR_EACH_I_R_I(r, macro, data, seq) MSGPACK_PP_FOR_ ## r((macro, data, seq (nil), 0), MSGPACK_PP_SEQ_FOR_EACH_I_P, MSGPACK_PP_SEQ_FOR_EACH_I_O, MSGPACK_PP_SEQ_FOR_EACH_I_M)
59 # endif
60 #
61 # endif