messagepack implementation for embedded systems (mbed / arduino)
Dependents: hello_message_pack
rest_n.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_LIST_REST_N_HPP 00015 # define MSGPACK_PREPROCESSOR_LIST_REST_N_HPP 00016 # 00017 # include <msgpack/preprocessor/arithmetic/dec.hpp> 00018 # include <msgpack/preprocessor/config/config.hpp> 00019 # include <msgpack/preprocessor/control/while.hpp> 00020 # include <msgpack/preprocessor/list/adt.hpp> 00021 # include <msgpack/preprocessor/tuple/elem.hpp> 00022 # 00023 # /* MSGPACK_PP_LIST_REST_N */ 00024 # 00025 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG() 00026 # define MSGPACK_PP_LIST_REST_N(count, list) MSGPACK_PP_TUPLE_ELEM(2, 0, MSGPACK_PP_WHILE(MSGPACK_PP_LIST_REST_N_P, MSGPACK_PP_LIST_REST_N_O, (list, count))) 00027 # else 00028 # define MSGPACK_PP_LIST_REST_N(count, list) MSGPACK_PP_LIST_REST_N_I(count, list) 00029 # define MSGPACK_PP_LIST_REST_N_I(count, list) MSGPACK_PP_TUPLE_ELEM(2, 0, MSGPACK_PP_WHILE(MSGPACK_PP_LIST_REST_N_P, MSGPACK_PP_LIST_REST_N_O, (list, count))) 00030 # endif 00031 # 00032 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG() 00033 # define MSGPACK_PP_LIST_REST_N_P(d, lc) MSGPACK_PP_TUPLE_ELEM(2, 1, lc) 00034 # else 00035 # define MSGPACK_PP_LIST_REST_N_P(d, lc) MSGPACK_PP_LIST_REST_N_P_I lc 00036 # define MSGPACK_PP_LIST_REST_N_P_I(list, count) count 00037 # endif 00038 # 00039 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG() 00040 # define MSGPACK_PP_LIST_REST_N_O(d, lc) (MSGPACK_PP_LIST_REST(MSGPACK_PP_TUPLE_ELEM(2, 0, lc)), MSGPACK_PP_DEC(MSGPACK_PP_TUPLE_ELEM(2, 1, lc))) 00041 # else 00042 # define MSGPACK_PP_LIST_REST_N_O(d, lc) MSGPACK_PP_LIST_REST_N_O_I lc 00043 # define MSGPACK_PP_LIST_REST_N_O_I(list, count) (MSGPACK_PP_LIST_REST(list), MSGPACK_PP_DEC(count)) 00044 # endif 00045 # 00046 # /* MSGPACK_PP_LIST_REST_N_D */ 00047 # 00048 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG() 00049 # define MSGPACK_PP_LIST_REST_N_D(d, count, list) MSGPACK_PP_TUPLE_ELEM(2, 0, MSGPACK_PP_WHILE_ ## d(MSGPACK_PP_LIST_REST_N_P, MSGPACK_PP_LIST_REST_N_O, (list, count))) 00050 # else 00051 # define MSGPACK_PP_LIST_REST_N_D(d, count, list) MSGPACK_PP_LIST_REST_N_D_I(d, count, list) 00052 # define MSGPACK_PP_LIST_REST_N_D_I(d, count, list) MSGPACK_PP_TUPLE_ELEM(2, 0, MSGPACK_PP_WHILE_ ## d(MSGPACK_PP_LIST_REST_N_P, MSGPACK_PP_LIST_REST_N_O, (list, count))) 00053 # endif 00054 # 00055 # endif
Generated on Tue Jul 12 2022 22:51:46 by 1.7.2