Hideaki Tai / msgpack-embedded

Dependents:   hello_message_pack

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers add.hpp Source File

add.hpp

00001 # /* Copyright (C) 2001
00002 #  * Housemarque Oy
00003 #  * http://www.housemarque.com
00004 #  *
00005 #  * Distributed under the Boost Software License, Version 1.0. (See
00006 #  * accompanying file LICENSE_1_0.txt or copy at
00007 #  * http://www.boost.org/LICENSE_1_0.txt)
00008 #  */
00009 #
00010 # /* Revised by Paul Mensonides (2002) */
00011 #
00012 # /* See http://www.boost.org for most recent version. */
00013 #
00014 # ifndef MSGPACK_PREPROCESSOR_ARITHMETIC_ADD_HPP
00015 # define MSGPACK_PREPROCESSOR_ARITHMETIC_ADD_HPP
00016 #
00017 # include <msgpack/preprocessor/arithmetic/dec.hpp>
00018 # include <msgpack/preprocessor/arithmetic/inc.hpp>
00019 # include <msgpack/preprocessor/config/config.hpp>
00020 # include <msgpack/preprocessor/control/while.hpp>
00021 # include <msgpack/preprocessor/tuple/elem.hpp>
00022 #
00023 # /* MSGPACK_PP_ADD */
00024 #
00025 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
00026 #    define MSGPACK_PP_ADD(x, y) MSGPACK_PP_TUPLE_ELEM(2, 0, MSGPACK_PP_WHILE(MSGPACK_PP_ADD_P, MSGPACK_PP_ADD_O, (x, y)))
00027 # else
00028 #    define MSGPACK_PP_ADD(x, y) MSGPACK_PP_ADD_I(x, y)
00029 #    define MSGPACK_PP_ADD_I(x, y) MSGPACK_PP_TUPLE_ELEM(2, 0, MSGPACK_PP_WHILE(MSGPACK_PP_ADD_P, MSGPACK_PP_ADD_O, (x, y)))
00030 # endif
00031 #
00032 # define MSGPACK_PP_ADD_P(d, xy) MSGPACK_PP_TUPLE_ELEM(2, 1, xy)
00033 #
00034 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MWCC()
00035 #    define MSGPACK_PP_ADD_O(d, xy) MSGPACK_PP_ADD_O_I xy
00036 # else
00037 #    define MSGPACK_PP_ADD_O(d, xy) MSGPACK_PP_ADD_O_I(MSGPACK_PP_TUPLE_ELEM(2, 0, xy), MSGPACK_PP_TUPLE_ELEM(2, 1, xy))
00038 # endif
00039 #
00040 # define MSGPACK_PP_ADD_O_I(x, y) (MSGPACK_PP_INC(x), MSGPACK_PP_DEC(y))
00041 #
00042 # /* MSGPACK_PP_ADD_D */
00043 #
00044 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
00045 #    define MSGPACK_PP_ADD_D(d, x, y) MSGPACK_PP_TUPLE_ELEM(2, 0, MSGPACK_PP_WHILE_ ## d(MSGPACK_PP_ADD_P, MSGPACK_PP_ADD_O, (x, y)))
00046 # else
00047 #    define MSGPACK_PP_ADD_D(d, x, y) MSGPACK_PP_ADD_D_I(d, x, y)
00048 #    define MSGPACK_PP_ADD_D_I(d, x, y) MSGPACK_PP_TUPLE_ELEM(2, 0, MSGPACK_PP_WHILE_ ## d(MSGPACK_PP_ADD_P, MSGPACK_PP_ADD_O, (x, y)))
00049 # endif
00050 #
00051 # endif