messagepack implementation for embedded systems (mbed / arduino)

Dependents:   hello_message_pack

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers check.hpp Source File

check.hpp

00001 # /* **************************************************************************
00002 #  *                                                                          *
00003 #  *     (C) Copyright Paul Mensonides 2002.
00004 #  *     Distributed under the Boost Software License, Version 1.0. (See
00005 #  *     accompanying file LICENSE_1_0.txt or copy at
00006 #  *     http://www.boost.org/LICENSE_1_0.txt)
00007 #  *                                                                          *
00008 #  ************************************************************************** */
00009 #
00010 # /* See http://www.boost.org for most recent version. */
00011 #
00012 # ifndef MSGPACK_PREPROCESSOR_DETAIL_CHECK_HPP
00013 # define MSGPACK_PREPROCESSOR_DETAIL_CHECK_HPP
00014 #
00015 # include <msgpack/preprocessor/cat.hpp>
00016 # include <msgpack/preprocessor/config/config.hpp>
00017 #
00018 # /* MSGPACK_PP_CHECK */
00019 #
00020 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MWCC()
00021 #    define MSGPACK_PP_CHECK(x, type) MSGPACK_PP_CHECK_D(x, type)
00022 # else
00023 #    define MSGPACK_PP_CHECK(x, type) MSGPACK_PP_CHECK_OO((x, type))
00024 #    define MSGPACK_PP_CHECK_OO(par) MSGPACK_PP_CHECK_D ## par
00025 # endif
00026 #
00027 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MSVC() && ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_DMC()
00028 #    define MSGPACK_PP_CHECK_D(x, type) MSGPACK_PP_CHECK_1(MSGPACK_PP_CAT(MSGPACK_PP_CHECK_RESULT_, type x))
00029 #    define MSGPACK_PP_CHECK_1(chk) MSGPACK_PP_CHECK_2(chk)
00030 #    define MSGPACK_PP_CHECK_2(res, _) res
00031 # elif MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_MSVC()
00032 #    define MSGPACK_PP_CHECK_D(x, type) MSGPACK_PP_CHECK_1(type x)
00033 #    define MSGPACK_PP_CHECK_1(chk) MSGPACK_PP_CHECK_2(chk)
00034 #    define MSGPACK_PP_CHECK_2(chk) MSGPACK_PP_CHECK_3((MSGPACK_PP_CHECK_RESULT_ ## chk))
00035 #    define MSGPACK_PP_CHECK_3(im) MSGPACK_PP_CHECK_5(MSGPACK_PP_CHECK_4 im)
00036 #    define MSGPACK_PP_CHECK_4(res, _) res
00037 #    define MSGPACK_PP_CHECK_5(res) res
00038 # else /* DMC */
00039 #    define MSGPACK_PP_CHECK_D(x, type) MSGPACK_PP_CHECK_OO((type x))
00040 #    define MSGPACK_PP_CHECK_OO(par) MSGPACK_PP_CHECK_0 ## par
00041 #    define MSGPACK_PP_CHECK_0(chk) MSGPACK_PP_CHECK_1(MSGPACK_PP_CAT(MSGPACK_PP_CHECK_RESULT_, chk))
00042 #    define MSGPACK_PP_CHECK_1(chk) MSGPACK_PP_CHECK_2(chk)
00043 #    define MSGPACK_PP_CHECK_2(res, _) res
00044 # endif
00045 #
00046 # define MSGPACK_PP_CHECK_RESULT_1 1, MSGPACK_PP_NIL
00047 #
00048 # endif