Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: hello_message_pack
versioning.hpp
00001 /* 00002 * MessagePack for C++ version switcher 00003 * 00004 * Copyright (C) 2014 KONDO Takatoshi 00005 * 00006 * Distributed under the Boost Software License, Version 1.0. 00007 * (See accompanying file LICENSE_1_0.txt or copy at 00008 * http://www.boost.org/LICENSE_1_0.txt) 00009 */ 00010 #ifndef MSGPACK_VERSIONING_HPP 00011 #define MSGPACK_VERSIONING_HPP 00012 00013 #if !defined(MSGPACK_DEFAULT_API_VERSION) 00014 #define MSGPACK_DEFAULT_API_VERSION 1 00015 #endif 00016 00017 #define MSGPACK_DEFAULT_API_NS MSGPACK_DETAIL_PP_CAT(v, MSGPACK_DEFAULT_API_VERSION) 00018 00019 #if MSGPACK_DEFAULT_API_VERSION == 1 00020 #define MSGPACK_DETAIL_PP_ENABLE_NS_v1 () 00021 //#elif MSGPACK_DEFAULT_API_VERSION == 2 00022 //#define MSGPACK_DETAIL_PP_ENABLE_NS_v2 () 00023 #else 00024 #error 00025 #endif 00026 00027 #define MSGPACK_DETAIL_PP_CAT(a, ...) MSGPACK_DETAIL_PP_PRIMITIVE_CAT(a, __VA_ARGS__) 00028 #define MSGPACK_DETAIL_PP_PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__ 00029 00030 #define MSGPACK_DETAIL_PP_IIF(c) MSGPACK_DETAIL_PP_PRIMITIVE_CAT(MSGPACK_DETAIL_PP_IIF_, c) 00031 #define MSGPACK_DETAIL_PP_IIF_0(t, ...) __VA_ARGS__ 00032 #define MSGPACK_DETAIL_PP_IIF_1(t, ...) t 00033 00034 #define MSGPACK_DETAIL_PP_PROBE(x) x, 1 00035 00036 #if defined(_MSC_VER) 00037 00038 #define MSGPACK_DETAIL_PP_MSVC_VA_ARGS_WORKAROUND(define, args) define args 00039 #define MSGPACK_DETAIL_PP_CHECK(...) MSGPACK_DETAIL_PP_MSVC_VA_ARGS_WORKAROUND(MSGPACK_DETAIL_PP_CHECK_N, (__VA_ARGS__, 0)) 00040 #define MSGPACK_DETAIL_PP_CHECK_N(x, n, ...) n 00041 00042 #else // defined(__MSC_VER) 00043 00044 #define MSGPACK_DETAIL_PP_CHECK(...) MSGPACK_DETAIL_PP_CHECK_N(__VA_ARGS__, 0) 00045 #define MSGPACK_DETAIL_PP_CHECK_N(x, n, ...) n 00046 00047 #endif // defined(__MSC_VER) 00048 00049 00050 #define MSGPACK_DETAIL_PP_NS_ENABLED_PROBE(ns) MSGPACK_DETAIL_PP_NS_ENABLED_PROBE_PROXY( MSGPACK_DETAIL_PP_ENABLE_NS_##ns ) 00051 #define MSGPACK_DETAIL_PP_NS_ENABLED_PROBE_PROXY(...) MSGPACK_DETAIL_PP_NS_ENABLED_PROBE_PRIMIVIE(__VA_ARGS__) 00052 #define MSGPACK_DETAIL_PP_NS_ENABLED_PROBE_PRIMIVIE(x) MSGPACK_DETAIL_PP_NS_ENABLED_PROBE_COMBINE_ x 00053 #define MSGPACK_DETAIL_PP_NS_ENABLED_PROBE_COMBINE_(...) MSGPACK_DETAIL_PP_PROBE(~) 00054 00055 #define MSGPACK_DETAIL_PP_IS_NS_ENABLED(ns) MSGPACK_DETAIL_PP_CHECK(MSGPACK_DETAIL_PP_NS_ENABLED_PROBE(ns)) 00056 00057 #if __cplusplus < 201103L 00058 #define MSGPACK_API_VERSION_NAMESPACE(ns) MSGPACK_DETAIL_PP_IIF(MSGPACK_DETAIL_PP_IS_NS_ENABLED(ns)) \ 00059 (namespace ns{}; using namespace ns; namespace ns, \ 00060 namespace ns) 00061 00062 #else // __cplusplus < 201103L 00063 00064 #define MSGPACK_API_VERSION_NAMESPACE(ns) MSGPACK_DETAIL_PP_IIF(MSGPACK_DETAIL_PP_IS_NS_ENABLED(ns)) \ 00065 (inline namespace ns, namespace ns) 00066 00067 #endif // __cplusplus < 201103L 00068 00069 #endif // MSGPACK_VERSIONING_HPP
Generated on Tue Jul 12 2022 22:51:46 by
1.7.2