зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1421501 - vendor msgpack from https://github.com/msgpack/msgpack-c r=glandium
MozReview-Commit-ID: 9vzQOuszf3p --HG-- extra : rebase_source : 51d10a8479d70a39311d16fbb874ac6869e5419f
This commit is contained in:
Родитель
20c3f148db
Коммит
51ac1fcfc7
|
@ -0,0 +1,20 @@
|
|||
This directory contains the msgpack source from the upstream repo:
|
||||
|
||||
https://github.com/msgpack/msgpack-c
|
||||
|
||||
Current version: cpp-3.1.0 [commit b6803a5fecbe321458faafd6a079dac466614ff9]
|
||||
|
||||
UPDATING:
|
||||
|
||||
Our in-tree copy of msgpack does not depend on any generated files from the
|
||||
upstream build system. Therefore, it should be sufficient to simply overwrite
|
||||
the in-tree files one the updated ones from upstream to perform updates.
|
||||
|
||||
To simplify this, the in-tree copy can be updated by running
|
||||
|
||||
sh update.sh
|
||||
|
||||
from within the third_party/msgpack directory.
|
||||
|
||||
If the collection of source files changes, manual updates to moz.build may be
|
||||
needed as we don't use the upstream makefiles.
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* MessagePack for C
|
||||
*
|
||||
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
/**
|
||||
* @defgroup msgpack MessagePack C
|
||||
* @{
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "msgpack/util.h"
|
||||
#include "msgpack/object.h"
|
||||
#include "msgpack/zone.h"
|
||||
#include "msgpack/pack.h"
|
||||
#include "msgpack/unpack.h"
|
||||
#include "msgpack/sbuffer.h"
|
||||
#include "msgpack/vrefbuffer.h"
|
||||
#include "msgpack/version.h"
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
// MessagePack for C++
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#include "msgpack/object.hpp"
|
||||
#include "msgpack/iterator.hpp"
|
||||
#include "msgpack/zone.hpp"
|
||||
#include "msgpack/pack.hpp"
|
||||
#include "msgpack/null_visitor.hpp"
|
||||
#include "msgpack/parse.hpp"
|
||||
#include "msgpack/unpack.hpp"
|
||||
#include "msgpack/x3_parse.hpp"
|
||||
#include "msgpack/x3_unpack.hpp"
|
||||
#include "msgpack/sbuffer.hpp"
|
||||
#include "msgpack/vrefbuffer.hpp"
|
||||
#include "msgpack/version.hpp"
|
||||
#include "msgpack/type.hpp"
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2015-2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_ADAPTOR_BASE_HPP
|
||||
#define MSGPACK_ADAPTOR_BASE_HPP
|
||||
|
||||
#include "msgpack/adaptor/adaptor_base_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/adaptor_base.hpp"
|
||||
#include "msgpack/v2/adaptor/adaptor_base.hpp"
|
||||
#include "msgpack/v3/adaptor/adaptor_base.hpp"
|
||||
|
||||
#endif // MSGPACK_ADAPTOR_BASE_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_ADAPTOR_BASE_DECL_HPP
|
||||
#define MSGPACK_ADAPTOR_BASE_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/adaptor_base_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/adaptor_base_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/adaptor_base_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_ADAPTOR_BASE_DECL_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_ARRAY_REF_HPP
|
||||
#define MSGPACK_TYPE_ARRAY_REF_HPP
|
||||
|
||||
#include "msgpack/adaptor/array_ref_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/array_ref.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_ARRAY_REFL_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_ARRAY_REF_DECL_HPP
|
||||
#define MSGPACK_TYPE_ARRAY_REF_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/array_ref_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/array_ref_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/array_ref_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_ARRAY_REF_DECL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOL_HPP
|
||||
#define MSGPACK_TYPE_BOOL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/bool.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_BOOL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOST_FUSION_HPP
|
||||
#define MSGPACK_TYPE_BOOST_FUSION_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/boost/fusion.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_BOOST_FUSION_HPP
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2015-2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_HPP
|
||||
#define MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_HPP
|
||||
|
||||
#include "msgpack/adaptor/boost/msgpack_variant_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/boost/msgpack_variant.hpp"
|
||||
//#include "msgpack/v2/adaptor/boost/msgpack_variant.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_HPP
|
17
third_party/msgpack/include/msgpack/adaptor/boost/msgpack_variant_decl.hpp
поставляемый
Normal file
17
third_party/msgpack/include/msgpack/adaptor/boost/msgpack_variant_decl.hpp
поставляемый
Normal file
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_DECL_HPP
|
||||
#define MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/boost/msgpack_variant_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/boost/msgpack_variant_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/boost/msgpack_variant_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_DECL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOST_OPTIONAL_HPP
|
||||
#define MSGPACK_TYPE_BOOST_OPTIONAL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/boost/optional.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_BOOST_OPTIONAL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOST_STRING_REF_HPP
|
||||
#define MSGPACK_TYPE_BOOST_STRING_REF_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/boost/string_ref.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_BOOST_STRING_REF_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2017 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOST_STRING_VIEW_HPP
|
||||
#define MSGPACK_TYPE_BOOST_STRING_VIEW_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/boost/string_view.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_BOOST_STRING_VIEW_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_CARRAY_HPP
|
||||
#define MSGPACK_TYPE_CARRAY_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/carray.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CARRAY_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_CHAR_PTR_HPP
|
||||
#define MSGPACK_TYPE_CHAR_PTR_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/char_ptr.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CHAR_PTR_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2015-2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CHECK_CONTAINER_SIZE_HPP
|
||||
#define MSGPACK_CHECK_CONTAINER_SIZE_HPP
|
||||
|
||||
#include "msgpack/adaptor/check_container_size_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/check_container_size.hpp"
|
||||
|
||||
#endif // MSGPACK_CHECK_CONTAINER_SIZE_HPP
|
17
third_party/msgpack/include/msgpack/adaptor/check_container_size_decl.hpp
поставляемый
Normal file
17
third_party/msgpack/include/msgpack/adaptor/check_container_size_decl.hpp
поставляемый
Normal file
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CHECK_CONTAINER_SIZE_DECL_HPP
|
||||
#define MSGPACK_CHECK_CONTAINER_SIZE_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/check_container_size_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/check_container_size_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/check_container_size_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_CHECK_CONTAINER_SIZE_DECL_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_ARRAY_HPP
|
||||
#define MSGPACK_TYPE_CPP11_ARRAY_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/array.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_ARRAY_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_ARRAY_CHAR_HPP
|
||||
#define MSGPACK_TYPE_CPP11_ARRAY_CHAR_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/array_char.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_ARRAY_CHAR_HPP
|
16
third_party/msgpack/include/msgpack/adaptor/cpp11/array_unsigned_char.hpp
поставляемый
Normal file
16
third_party/msgpack/include/msgpack/adaptor/cpp11/array_unsigned_char.hpp
поставляемый
Normal file
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_ARRAY_UNSIGNED_CHAR_HPP
|
||||
#define MSGPACK_TYPE_CPP11_ARRAY_UNSIGNED_CHAR_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/array_unsigned_char.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_ARRAY_UNSIGNED_CHAR_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2017 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_CHRONO_HPP
|
||||
#define MSGPACK_TYPE_CPP11_CHRONO_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/chrono.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_CHRONO_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_FORWARD_LIST_HPP
|
||||
#define MSGPACK_TYPE_CPP11_FORWARD_LIST_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/forward_list.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_FORWARD_LIST_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_REFERENCE_WRAPPER_HPP
|
||||
#define MSGPACK_TYPE_CPP11_REFERENCE_WRAPPER_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/reference_wrapper.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_REFERENCE_WRAPPER_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_SHARED_PTR_HPP
|
||||
#define MSGPACK_TYPE_CPP11_SHARED_PTR_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/shared_ptr.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_SHARED_PTR_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_TUPLE_HPP
|
||||
#define MSGPACK_TYPE_CPP11_TUPLE_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/tuple.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_TUPLE_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_UNIQUE_PTR_HPP
|
||||
#define MSGPACK_TYPE_CPP11_UNIQUE_PTR_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/unique_ptr.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_UNIQUE_PTR_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_UNORDERED_MAP_HPP
|
||||
#define MSGPACK_TYPE_CPP11_UNORDERED_MAP_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/unordered_map.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_UNORDERED_MAP_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP11_UNORDERED_SET_HPP
|
||||
#define MSGPACK_TYPE_CPP11_UNORDERED_SET_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp11/unordered_set.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP11_UNORDERED_SET_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2018 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP17_BYTE_HPP
|
||||
#define MSGPACK_TYPE_CPP17_BYTE_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp17/byte.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP17_BYTE_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2018 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP17_CARRAY_BYTE_HPP
|
||||
#define MSGPACK_TYPE_CPP17_CARRAY_BYTE_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp17/carray_byte.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP17_CARRAY_BYTE_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2017 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP17_OPTIONAL_HPP
|
||||
#define MSGPACK_TYPE_CPP17_OPTIONAL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp17/optional.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP17_OPTIONAL_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2017 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP17_STRING_VIEW_HPP
|
||||
#define MSGPACK_TYPE_CPP17_STRING_VIEW_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp17/string_view.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP17_STRING_VIEW_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2018 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_TYPE_CPP17_VECTOR_BYTE_HPP
|
||||
#define MSGPACK_TYPE_CPP17_VECTOR_BYTE_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/cpp17/vector_byte.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_CPP17_VECTOR_BYTE_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_DEFINE_HPP
|
||||
#define MSGPACK_DEFINE_HPP
|
||||
|
||||
#include "msgpack/adaptor/define_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/define.hpp"
|
||||
|
||||
#endif // MSGPACK_DEFINE_HPP
|
|
@ -0,0 +1,144 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_DEFINE_DECL_HPP
|
||||
#define MSGPACK_DEFINE_DECL_HPP
|
||||
|
||||
// BOOST_PP_VARIADICS is defined in boost/preprocessor/config/config.hpp
|
||||
// http://www.boost.org/libs/preprocessor/doc/ref/variadics.html
|
||||
// However, supporting compiler detection is not complete. msgpack-c requires
|
||||
// variadic macro arguments support. So BOOST_PP_VARIADICS is defined here explicitly.
|
||||
#if !defined(MSGPACK_PP_VARIADICS)
|
||||
#define MSGPACK_PP_VARIADICS
|
||||
#endif
|
||||
|
||||
#include <msgpack/preprocessor.hpp>
|
||||
|
||||
#include "msgpack/versioning.hpp"
|
||||
|
||||
// for MSGPACK_ADD_ENUM
|
||||
#include "msgpack/adaptor/int.hpp"
|
||||
|
||||
#define MSGPACK_DEFINE_ARRAY(...) \
|
||||
template <typename Packer> \
|
||||
void msgpack_pack(Packer& msgpack_pk) const \
|
||||
{ \
|
||||
msgpack::type::make_define_array(__VA_ARGS__).msgpack_pack(msgpack_pk); \
|
||||
} \
|
||||
void msgpack_unpack(msgpack::object const& msgpack_o) \
|
||||
{ \
|
||||
msgpack::type::make_define_array(__VA_ARGS__).msgpack_unpack(msgpack_o); \
|
||||
}\
|
||||
template <typename MSGPACK_OBJECT> \
|
||||
void msgpack_object(MSGPACK_OBJECT* msgpack_o, msgpack::zone& msgpack_z) const \
|
||||
{ \
|
||||
msgpack::type::make_define_array(__VA_ARGS__).msgpack_object(msgpack_o, msgpack_z); \
|
||||
}
|
||||
|
||||
#define MSGPACK_BASE_ARRAY(base) (*const_cast<base *>(static_cast<base const*>(this)))
|
||||
#define MSGPACK_NVP(name, value) (name) (value)
|
||||
|
||||
#define MSGPACK_DEFINE_MAP_EACH_PROC(r, data, elem) \
|
||||
MSGPACK_PP_IF( \
|
||||
MSGPACK_PP_IS_BEGIN_PARENS(elem), \
|
||||
elem, \
|
||||
(MSGPACK_PP_STRINGIZE(elem))(elem) \
|
||||
)
|
||||
|
||||
#define MSGPACK_DEFINE_MAP_IMPL(...) \
|
||||
MSGPACK_PP_SEQ_TO_TUPLE( \
|
||||
MSGPACK_PP_SEQ_FOR_EACH( \
|
||||
MSGPACK_DEFINE_MAP_EACH_PROC, \
|
||||
0, \
|
||||
MSGPACK_PP_VARIADIC_TO_SEQ(__VA_ARGS__) \
|
||||
) \
|
||||
)
|
||||
|
||||
#define MSGPACK_DEFINE_MAP(...) \
|
||||
template <typename Packer> \
|
||||
void msgpack_pack(Packer& msgpack_pk) const \
|
||||
{ \
|
||||
msgpack::type::make_define_map \
|
||||
MSGPACK_DEFINE_MAP_IMPL(__VA_ARGS__) \
|
||||
.msgpack_pack(msgpack_pk); \
|
||||
} \
|
||||
void msgpack_unpack(msgpack::object const& msgpack_o) \
|
||||
{ \
|
||||
msgpack::type::make_define_map \
|
||||
MSGPACK_DEFINE_MAP_IMPL(__VA_ARGS__) \
|
||||
.msgpack_unpack(msgpack_o); \
|
||||
}\
|
||||
template <typename MSGPACK_OBJECT> \
|
||||
void msgpack_object(MSGPACK_OBJECT* msgpack_o, msgpack::zone& msgpack_z) const \
|
||||
{ \
|
||||
msgpack::type::make_define_map \
|
||||
MSGPACK_DEFINE_MAP_IMPL(__VA_ARGS__) \
|
||||
.msgpack_object(msgpack_o, msgpack_z); \
|
||||
}
|
||||
|
||||
#define MSGPACK_BASE_MAP(base) \
|
||||
(MSGPACK_PP_STRINGIZE(base))(*const_cast<base *>(static_cast<base const*>(this)))
|
||||
|
||||
// MSGPACK_ADD_ENUM must be used in the global namespace.
|
||||
#define MSGPACK_ADD_ENUM(enum_name) \
|
||||
namespace msgpack { \
|
||||
/** @cond */ \
|
||||
MSGPACK_API_VERSION_NAMESPACE(MSGPACK_DEFAULT_API_NS) { \
|
||||
/** @endcond */ \
|
||||
namespace adaptor { \
|
||||
template<> \
|
||||
struct convert<enum_name> { \
|
||||
msgpack::object const& operator()(msgpack::object const& msgpack_o, enum_name& msgpack_v) const { \
|
||||
msgpack::underlying_type<enum_name>::type tmp; \
|
||||
msgpack::operator>>(msgpack_o, tmp); \
|
||||
msgpack_v = static_cast<enum_name>(tmp); \
|
||||
return msgpack_o; \
|
||||
} \
|
||||
}; \
|
||||
template<> \
|
||||
struct object<enum_name> { \
|
||||
void operator()(msgpack::object& msgpack_o, const enum_name& msgpack_v) const { \
|
||||
msgpack::underlying_type<enum_name>::type tmp = static_cast<msgpack::underlying_type<enum_name>::type>(msgpack_v); \
|
||||
msgpack::operator<<(msgpack_o, tmp); \
|
||||
} \
|
||||
}; \
|
||||
template<> \
|
||||
struct object_with_zone<enum_name> { \
|
||||
void operator()(msgpack::object::with_zone& msgpack_o, const enum_name& msgpack_v) const { \
|
||||
msgpack::underlying_type<enum_name>::type tmp = static_cast<msgpack::underlying_type<enum_name>::type>(msgpack_v); \
|
||||
msgpack::operator<<(msgpack_o, tmp); \
|
||||
} \
|
||||
}; \
|
||||
template <> \
|
||||
struct pack<enum_name> { \
|
||||
template <typename Stream> \
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& msgpack_o, const enum_name& msgpack_v) const { \
|
||||
return msgpack::operator<<(msgpack_o, static_cast<msgpack::underlying_type<enum_name>::type>(msgpack_v)); \
|
||||
} \
|
||||
}; \
|
||||
} \
|
||||
/** @cond */ \
|
||||
} \
|
||||
/** @endcond */ \
|
||||
}
|
||||
|
||||
#if defined(MSGPACK_USE_DEFINE_MAP)
|
||||
#define MSGPACK_DEFINE MSGPACK_DEFINE_MAP
|
||||
#define MSGPACK_BASE MSGPACK_BASE_MAP
|
||||
#else // defined(MSGPACK_USE_DEFINE_MAP)
|
||||
#define MSGPACK_DEFINE MSGPACK_DEFINE_ARRAY
|
||||
#define MSGPACK_BASE MSGPACK_BASE_ARRAY
|
||||
#endif // defined(MSGPACK_USE_DEFINE_MAP)
|
||||
|
||||
|
||||
#include "msgpack/v1/adaptor/define_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/define_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/define_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_DEFINE_DECL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_DEQUE_HPP
|
||||
#define MSGPACK_TYPE_DEQUE_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/deque.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_DEQUE_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_EXT_HPP
|
||||
#define MSGPACK_TYPE_EXT_HPP
|
||||
|
||||
#include "msgpack/adaptor/ext_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/ext.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_EXT_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_EXT_DECL_HPP
|
||||
#define MSGPACK_TYPE_EXT_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/ext_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/ext_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/ext_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_EXT_DECL_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_FIXINT_HPP
|
||||
#define MSGPACK_TYPE_FIXINT_HPP
|
||||
|
||||
#include "msgpack/adaptor/fixint_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/fixint.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_FIXINT_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_FIXINT_DECL_HPP
|
||||
#define MSGPACK_TYPE_FIXINT_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/fixint_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/fixint_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/fixint_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_FIXINT_DECL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_FLOAT_HPP
|
||||
#define MSGPACK_TYPE_FLOAT_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/float.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_FLOAT_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_INT_HPP
|
||||
#define MSGPACK_TYPE_INT_HPP
|
||||
|
||||
#include "msgpack/adaptor/int_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/int.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_INT_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_INT_DECL_HPP
|
||||
#define MSGPACK_TYPE_INT_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/int_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/int_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/int_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_INT_DECL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_LIST_HPP
|
||||
#define MSGPACK_TYPE_LIST_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/list.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_LIST_HPP
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_MAP_HPP
|
||||
#define MSGPACK_TYPE_MAP_HPP
|
||||
|
||||
#include "msgpack/adaptor/map_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/map.hpp"
|
||||
|
||||
|
||||
#endif // MSGPACK_TYPE_MAP_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_MAP_DECL_HPP
|
||||
#define MSGPACK_TYPE_MAP_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/map_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/map_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/map_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_MAP_DECL_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2014 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_MSGPACK_TUPLE_HPP
|
||||
#define MSGPACK_MSGPACK_TUPLE_HPP
|
||||
|
||||
#include "msgpack/adaptor/msgpack_tuple_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/msgpack_tuple.hpp"
|
||||
|
||||
#endif // MSGPACK_MSGPACK_TUPLE_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_MSGPACK_TUPLE_DECL_HPP
|
||||
#define MSGPACK_MSGPACK_TUPLE_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/msgpack_tuple_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/msgpack_tuple_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/msgpack_tuple_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_MSGPACK_TUPLE_DECL_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_NIL_HPP
|
||||
#define MSGPACK_TYPE_NIL_HPP
|
||||
|
||||
#include "msgpack/adaptor/nil_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/nil.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_NIL_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_NIL_DECL_HPP
|
||||
#define MSGPACK_TYPE_NIL_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/nil_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/nil_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/nil_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_NIL_DECL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_PAIR_HPP
|
||||
#define MSGPACK_TYPE_PAIR_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/pair.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_PAIR_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_RAW_HPP
|
||||
#define MSGPACK_TYPE_RAW_HPP
|
||||
|
||||
#include "msgpack/adaptor/raw_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/raw.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_RAW_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_RAW_DECL_HPP
|
||||
#define MSGPACK_TYPE_RAW_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/raw_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/raw_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/raw_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_RAW_DECL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_SET_HPP
|
||||
#define MSGPACK_TYPE_SET_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/set.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_SET_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_SIZE_EQUAL_ONLY_HPP
|
||||
#define MSGPACK_TYPE_SIZE_EQUAL_ONLY_HPP
|
||||
|
||||
#include "msgpack/adaptor/size_equal_only_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/size_equal_only.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_SIZE_EQUAL_ONLYL_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_SIZE_EQUAL_ONLY_DECL_HPP
|
||||
#define MSGPACK_TYPE_SIZE_EQUAL_ONLY_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/size_equal_only_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/size_equal_only_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/size_equal_only_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_SIZE_EQUAL_ONLY_DECL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_STRING_HPP
|
||||
#define MSGPACK_TYPE_STRING_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/string.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_STRING_HPP
|
|
@ -0,0 +1,171 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_TR1_UNORDERED_MAP_HPP
|
||||
#define MSGPACK_TYPE_TR1_UNORDERED_MAP_HPP
|
||||
|
||||
#include "msgpack/versioning.hpp"
|
||||
#include "msgpack/adaptor/adaptor_base.hpp"
|
||||
#include "msgpack/adaptor/check_container_size.hpp"
|
||||
|
||||
#if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
|
||||
|
||||
#define MSGPACK_HAS_STD_UNORDERED_MAP
|
||||
#include <unordered_map>
|
||||
#define MSGPACK_STD_TR1 std
|
||||
|
||||
#else // defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
|
||||
|
||||
#if __GNUC__ >= 4
|
||||
|
||||
#define MSGPACK_HAS_STD_TR1_UNORDERED_MAP
|
||||
|
||||
#include <tr1/unordered_map>
|
||||
#define MSGPACK_STD_TR1 std::tr1
|
||||
|
||||
#endif // __GNUC__ >= 4
|
||||
|
||||
#endif // defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
|
||||
|
||||
#if defined(MSGPACK_STD_TR1)
|
||||
|
||||
namespace msgpack {
|
||||
|
||||
/// @cond
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
/// @endcond
|
||||
|
||||
namespace adaptor {
|
||||
|
||||
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
|
||||
struct convert<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> > {
|
||||
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>& v) const {
|
||||
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
|
||||
msgpack::object_kv* p(o.via.map.ptr);
|
||||
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> tmp;
|
||||
for(; p != pend; ++p) {
|
||||
K key;
|
||||
p->key.convert(key);
|
||||
p->val.convert(tmp[key]);
|
||||
}
|
||||
tmp.swap(v);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
|
||||
struct pack<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> > {
|
||||
template <typename Stream>
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>& v) const {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
o.pack_map(size);
|
||||
for(typename MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin()), it_end(v.end());
|
||||
it != it_end; ++it) {
|
||||
o.pack(it->first);
|
||||
o.pack(it->second);
|
||||
}
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
|
||||
struct object_with_zone<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> > {
|
||||
void operator()(msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>& v) const {
|
||||
o.type = msgpack::type::MAP;
|
||||
if(v.empty()) {
|
||||
o.via.map.ptr = MSGPACK_NULLPTR;
|
||||
o.via.map.size = 0;
|
||||
} else {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*size, MSGPACK_ZONE_ALIGNOF(msgpack::object_kv)));
|
||||
msgpack::object_kv* const pend = p + size;
|
||||
o.via.map.ptr = p;
|
||||
o.via.map.size = size;
|
||||
typename MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin());
|
||||
do {
|
||||
p->key = msgpack::object(it->first, o.zone);
|
||||
p->val = msgpack::object(it->second, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
|
||||
struct convert<MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> > {
|
||||
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>& v) const {
|
||||
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
|
||||
msgpack::object_kv* p(o.via.map.ptr);
|
||||
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> tmp;
|
||||
for(; p != pend; ++p) {
|
||||
std::pair<K, V> value;
|
||||
p->key.convert(value.first);
|
||||
p->val.convert(value.second);
|
||||
tmp.insert(value);
|
||||
}
|
||||
tmp.swap(v);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
|
||||
struct pack<MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> > {
|
||||
template <typename Stream>
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>& v) const {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
o.pack_map(size);
|
||||
for(typename MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin()), it_end(v.end());
|
||||
it != it_end; ++it) {
|
||||
o.pack(it->first);
|
||||
o.pack(it->second);
|
||||
}
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
|
||||
struct object_with_zone<MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> > {
|
||||
void operator()(msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>& v) const {
|
||||
o.type = msgpack::type::MAP;
|
||||
if(v.empty()) {
|
||||
o.via.map.ptr = MSGPACK_NULLPTR;
|
||||
o.via.map.size = 0;
|
||||
} else {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*size, MSGPACK_ZONE_ALIGNOF(msgpack::object_kv)));
|
||||
msgpack::object_kv* const pend = p + size;
|
||||
o.via.map.ptr = p;
|
||||
o.via.map.size = size;
|
||||
typename MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin());
|
||||
do {
|
||||
p->key = msgpack::object(it->first, o.zone);
|
||||
p->val = msgpack::object(it->second, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace adaptor
|
||||
|
||||
/// @cond
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
/// @endcond
|
||||
|
||||
} // namespace msgpack
|
||||
|
||||
#undef MSGPACK_STD_TR1
|
||||
|
||||
#endif // MSGPACK_STD_TR1
|
||||
|
||||
#endif // MSGPACK_TYPE_TR1_UNORDERED_MAP_HPP
|
|
@ -0,0 +1,165 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_TR1_UNORDERED_SET_HPP
|
||||
#define MSGPACK_TYPE_TR1_UNORDERED_SET_HPP
|
||||
|
||||
#include "msgpack/versioning.hpp"
|
||||
#include "msgpack/adaptor/adaptor_base.hpp"
|
||||
#include "msgpack/adaptor/check_container_size.hpp"
|
||||
|
||||
#if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
|
||||
|
||||
#define MSGPACK_HAS_STD_UNORDERED_SET
|
||||
#include <unordered_set>
|
||||
#define MSGPACK_STD_TR1 std
|
||||
|
||||
#else // defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
|
||||
|
||||
#if __GNUC__ >= 4
|
||||
|
||||
#define MSGPACK_HAS_STD_TR1_UNORDERED_SET
|
||||
|
||||
#include <tr1/unordered_set>
|
||||
#define MSGPACK_STD_TR1 std::tr1
|
||||
|
||||
#endif // __GNUC__ >= 4
|
||||
|
||||
#endif // defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)
|
||||
|
||||
#if defined(MSGPACK_STD_TR1)
|
||||
|
||||
namespace msgpack {
|
||||
|
||||
/// @cond
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
/// @endcond
|
||||
|
||||
namespace adaptor {
|
||||
|
||||
template <typename T, typename Hash, typename Compare, typename Alloc>
|
||||
struct convert<MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc> > {
|
||||
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>& v) const {
|
||||
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
|
||||
msgpack::object* p = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* const pbegin = o.via.array.ptr;
|
||||
MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc> tmp;
|
||||
while(p > pbegin) {
|
||||
--p;
|
||||
tmp.insert(p->as<T>());
|
||||
}
|
||||
tmp.swap(v);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename Hash, typename Compare, typename Alloc>
|
||||
struct pack<MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc> > {
|
||||
template <typename Stream>
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>& v) const {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
o.pack_array(size);
|
||||
for(typename MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>::const_iterator it(v.begin()), it_end(v.end());
|
||||
it != it_end; ++it) {
|
||||
o.pack(*it);
|
||||
}
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename Hash, typename Compare, typename Alloc>
|
||||
struct object_with_zone<MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc> > {
|
||||
void operator()(msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>& v) const {
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = MSGPACK_NULLPTR;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*size, MSGPACK_ZONE_ALIGNOF(msgpack::object)));
|
||||
msgpack::object* const pend = p + size;
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = size;
|
||||
typename MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename T, typename Hash, typename Compare, typename Alloc>
|
||||
struct convert<MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc> > {
|
||||
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>& v) const {
|
||||
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
|
||||
msgpack::object* p = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* const pbegin = o.via.array.ptr;
|
||||
MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc> tmp;
|
||||
while(p > pbegin) {
|
||||
--p;
|
||||
tmp.insert(p->as<T>());
|
||||
}
|
||||
tmp.swap(v);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename Hash, typename Compare, typename Alloc>
|
||||
struct pack<MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc> > {
|
||||
template <typename Stream>
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>& v) const {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
o.pack_array(size);
|
||||
for(typename MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>::const_iterator it(v.begin()), it_end(v.end());
|
||||
it != it_end; ++it) {
|
||||
o.pack(*it);
|
||||
}
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename Hash, typename Compare, typename Alloc>
|
||||
struct object_with_zone<MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc> > {
|
||||
void operator()(msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>& v) const {
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = MSGPACK_NULLPTR;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*size, MSGPACK_ZONE_ALIGNOF(msgpack::object)));
|
||||
msgpack::object* const pend = p + size;
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = size;
|
||||
typename MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace adaptor
|
||||
|
||||
/// @cond
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
/// @endcond
|
||||
|
||||
} // namespace msgpack
|
||||
|
||||
#undef MSGPACK_STD_TR1
|
||||
|
||||
#endif // MSGPACK_STD_TR1
|
||||
|
||||
#endif // MSGPACK_TYPE_TR1_UNORDERED_SET_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_V4RAW_HPP
|
||||
#define MSGPACK_TYPE_V4RAW_HPP
|
||||
|
||||
#include "msgpack/adaptor/v4raw_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/adaptor/v4raw.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_V4RAW_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_V4RAW_DECL_HPP
|
||||
#define MSGPACK_TYPE_V4RAW_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/v4raw_decl.hpp"
|
||||
#include "msgpack/v2/adaptor/v4raw_decl.hpp"
|
||||
#include "msgpack/v3/adaptor/v4raw_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_V4RAW_DECL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_VECTOR_HPP
|
||||
#define MSGPACK_TYPE_VECTOR_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/vector.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_VECTOR_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_VECTOR_BOOL_HPP
|
||||
#define MSGPACK_TYPE_VECTOR_BOOL_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/vector_bool.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_VECTOR_BOOL_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_VECTOR_CHAR_HPP
|
||||
#define MSGPACK_TYPE_VECTOR_CHAR_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/vector_char.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_VECTOR_CHAR_HPP
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_VECTOR_UNSIGNED_CHAR_HPP
|
||||
#define MSGPACK_TYPE_VECTOR_UNSIGNED_CHAR_HPP
|
||||
|
||||
#include "msgpack/v1/adaptor/vector_unsigned_char.hpp"
|
||||
|
||||
#endif // MSGPACK_TYPE_VECTOR_UNSIGNED_CHAR_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ C++03/C++11 Adaptation
|
||||
//
|
||||
// Copyright (C) 2013-2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP_CONFIG_HPP
|
||||
#define MSGPACK_CPP_CONFIG_HPP
|
||||
|
||||
#include "msgpack/cpp_config_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/cpp_config.hpp"
|
||||
|
||||
#endif // MSGPACK_CPP_CONFIG_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ C++03/C++11 Adaptation
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP_CONFIG_DECL_HPP
|
||||
#define MSGPACK_CPP_CONFIG_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/cpp_config_decl.hpp"
|
||||
#include "msgpack/v2/cpp_config_decl.hpp"
|
||||
#include "msgpack/v3/cpp_config_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_CPP_CONFIG_DECL_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ deserializing routine
|
||||
//
|
||||
// Copyright (C) 2018 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CREATE_OBJECT_VISITOR_HPP
|
||||
#define MSGPACK_CREATE_OBJECT_VISITOR_HPP
|
||||
|
||||
#include "msgpack/create_object_visitor_decl.hpp"
|
||||
|
||||
#include "msgpack/v2/create_object_visitor.hpp"
|
||||
|
||||
#endif // MSGPACK_CREATE_OBJECT_VISITOR_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ deserializing routine
|
||||
//
|
||||
// Copyright (C) 2018 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CREATE_OBJECT_VISITOR_DECL_HPP
|
||||
#define MSGPACK_CREATE_OBJECT_VISITOR_DECL_HPP
|
||||
|
||||
#include "msgpack/v2/create_object_visitor_decl.hpp"
|
||||
#include "msgpack/v3/create_object_visitor_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_CREATE_OBJECT_VISITOR_DECL_HPP
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* MessagePack for C FILE* buffer adaptor
|
||||
*
|
||||
* Copyright (C) 2013 Vladimir Volodko
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef MSGPACK_FBUFFER_H
|
||||
#define MSGPACK_FBUFFER_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup msgpack_fbuffer FILE* buffer
|
||||
* @ingroup msgpack_buffer
|
||||
* @{
|
||||
*/
|
||||
|
||||
static inline int msgpack_fbuffer_write(void* data, const char* buf, size_t len)
|
||||
{
|
||||
return (len == fwrite(buf, len, 1, (FILE *)data)) ? 0 : -1;
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* msgpack/fbuffer.h */
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ FILE* buffer adaptor
|
||||
//
|
||||
// Copyright (C) 2013 Vladimir Volodko
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_FBUFFER_HPP
|
||||
#define MSGPACK_FBUFFER_HPP
|
||||
|
||||
#include "msgpack/fbuffer_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/fbuffer.hpp"
|
||||
|
||||
#endif // MSGPACK_FBUFFER_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ FILE* buffer adaptor
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_FBUFFER_DECL_HPP
|
||||
#define MSGPACK_FBUFFER_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/fbuffer_decl.hpp"
|
||||
#include "msgpack/v2/fbuffer_decl.hpp"
|
||||
#include "msgpack/v3/fbuffer_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_FBUFFER_DECL_HPP
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef MSGPACK_GCC_ATOMIC_H
|
||||
#define MSGPACK_GCC_ATOMIC_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef int _msgpack_atomic_counter_t;
|
||||
|
||||
int _msgpack_sync_decr_and_fetch(volatile _msgpack_atomic_counter_t* ptr);
|
||||
int _msgpack_sync_incr_and_fetch(volatile _msgpack_atomic_counter_t* ptr);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // MSGPACK_GCC_ATOMIC_H
|
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// MessagePack for C++ old gcc workaround for atomic operation
|
||||
//
|
||||
// Copyright (C) 2008-2013 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_GCC_ATOMIC_HPP
|
||||
#define MSGPACK_GCC_ATOMIC_HPP
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41)
|
||||
|
||||
#include "msgpack/gcc_atomic.h"
|
||||
#include <bits/atomicity.h>
|
||||
|
||||
int _msgpack_sync_decr_and_fetch(volatile _msgpack_atomic_counter_t* ptr)
|
||||
{
|
||||
return __gnu_cxx::__exchange_and_add(ptr, -1) - 1;
|
||||
}
|
||||
|
||||
int _msgpack_sync_incr_and_fetch(volatile _msgpack_atomic_counter_t* ptr)
|
||||
{
|
||||
return __gnu_cxx::__exchange_and_add(ptr, 1) + 1;
|
||||
}
|
||||
|
||||
#endif // old gcc workaround
|
||||
|
||||
#endif /* gcc_atomic.hpp */
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2015-2016 MIZUKI Hirata
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_ITERATOR_HPP
|
||||
#define MSGPACK_ITERATOR_HPP
|
||||
|
||||
#include <msgpack/iterator_decl.hpp>
|
||||
|
||||
#include <msgpack/v1/iterator.hpp>
|
||||
|
||||
#endif // MSGPACK_ITERATOR_HPP
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_ITERATOR_DECL_HPP
|
||||
#define MSGPACK_ITERATOR_DECL_HPP
|
||||
|
||||
#include <msgpack/v1/iterator_decl.hpp>
|
||||
#include <msgpack/v2/iterator_decl.hpp>
|
||||
#include <msgpack/v3/iterator_decl.hpp>
|
||||
|
||||
#endif // MSGPACK_ITERATOR_DECL_HPP
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2015-2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_META_HPP
|
||||
#define MSGPACK_META_HPP
|
||||
|
||||
#include "msgpack/meta_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/meta.hpp"
|
||||
|
||||
#endif // MSGPACK_META_HPP
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2015-2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_META_DECL_HPP
|
||||
#define MSGPACK_META_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/meta_decl.hpp"
|
||||
#include "msgpack/v2/meta_decl.hpp"
|
||||
#include "msgpack/v3/meta_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_META_DECL_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ deserializing routine
|
||||
//
|
||||
// Copyright (C) 2018 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_NULL_VISITOR_HPP
|
||||
#define MSGPACK_NULL_VISITOR_HPP
|
||||
|
||||
#include "msgpack/null_visitor_decl.hpp"
|
||||
|
||||
#include "msgpack/v2/null_visitor.hpp"
|
||||
|
||||
#endif // MSGPACK_NULL_VISITOR_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ deserializing routine
|
||||
//
|
||||
// Copyright (C) 2018 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_NULL_VISITOR_DECL_HPP
|
||||
#define MSGPACK_NULL_VISITOR_DECL_HPP
|
||||
|
||||
#include "msgpack/v2/null_visitor_decl.hpp"
|
||||
#include "msgpack/v3/null_visitor_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_NULL_VISITOR_DECL_HPP
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* MessagePack for C dynamic typing routine
|
||||
*
|
||||
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef MSGPACK_OBJECT_H
|
||||
#define MSGPACK_OBJECT_H
|
||||
|
||||
#include "zone.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup msgpack_object Dynamically typed object
|
||||
* @ingroup msgpack
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
MSGPACK_OBJECT_NIL = 0x00,
|
||||
MSGPACK_OBJECT_BOOLEAN = 0x01,
|
||||
MSGPACK_OBJECT_POSITIVE_INTEGER = 0x02,
|
||||
MSGPACK_OBJECT_NEGATIVE_INTEGER = 0x03,
|
||||
MSGPACK_OBJECT_FLOAT32 = 0x0a,
|
||||
MSGPACK_OBJECT_FLOAT64 = 0x04,
|
||||
MSGPACK_OBJECT_FLOAT = 0x04,
|
||||
#if defined(MSGPACK_USE_LEGACY_NAME_AS_FLOAT)
|
||||
MSGPACK_OBJECT_DOUBLE = MSGPACK_OBJECT_FLOAT, /* obsolete */
|
||||
#endif /* MSGPACK_USE_LEGACY_NAME_AS_FLOAT */
|
||||
MSGPACK_OBJECT_STR = 0x05,
|
||||
MSGPACK_OBJECT_ARRAY = 0x06,
|
||||
MSGPACK_OBJECT_MAP = 0x07,
|
||||
MSGPACK_OBJECT_BIN = 0x08,
|
||||
MSGPACK_OBJECT_EXT = 0x09
|
||||
} msgpack_object_type;
|
||||
|
||||
|
||||
struct msgpack_object;
|
||||
struct msgpack_object_kv;
|
||||
|
||||
typedef struct {
|
||||
uint32_t size;
|
||||
struct msgpack_object* ptr;
|
||||
} msgpack_object_array;
|
||||
|
||||
typedef struct {
|
||||
uint32_t size;
|
||||
struct msgpack_object_kv* ptr;
|
||||
} msgpack_object_map;
|
||||
|
||||
typedef struct {
|
||||
uint32_t size;
|
||||
const char* ptr;
|
||||
} msgpack_object_str;
|
||||
|
||||
typedef struct {
|
||||
uint32_t size;
|
||||
const char* ptr;
|
||||
} msgpack_object_bin;
|
||||
|
||||
typedef struct {
|
||||
int8_t type;
|
||||
uint32_t size;
|
||||
const char* ptr;
|
||||
} msgpack_object_ext;
|
||||
|
||||
typedef union {
|
||||
bool boolean;
|
||||
uint64_t u64;
|
||||
int64_t i64;
|
||||
#if defined(MSGPACK_USE_LEGACY_NAME_AS_FLOAT)
|
||||
double dec; /* obsolete*/
|
||||
#endif /* MSGPACK_USE_LEGACY_NAME_AS_FLOAT */
|
||||
double f64;
|
||||
msgpack_object_array array;
|
||||
msgpack_object_map map;
|
||||
msgpack_object_str str;
|
||||
msgpack_object_bin bin;
|
||||
msgpack_object_ext ext;
|
||||
} msgpack_object_union;
|
||||
|
||||
typedef struct msgpack_object {
|
||||
msgpack_object_type type;
|
||||
msgpack_object_union via;
|
||||
} msgpack_object;
|
||||
|
||||
typedef struct msgpack_object_kv {
|
||||
msgpack_object key;
|
||||
msgpack_object val;
|
||||
} msgpack_object_kv;
|
||||
|
||||
MSGPACK_DLLEXPORT
|
||||
void msgpack_object_print(FILE* out, msgpack_object o);
|
||||
|
||||
MSGPACK_DLLEXPORT
|
||||
int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o);
|
||||
|
||||
MSGPACK_DLLEXPORT
|
||||
bool msgpack_object_equal(const msgpack_object x, const msgpack_object y);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* msgpack/object.h */
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_OBJECT_HPP
|
||||
#define MSGPACK_OBJECT_HPP
|
||||
|
||||
#include "msgpack/object_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/object.hpp"
|
||||
#include "msgpack/v2/object.hpp"
|
||||
|
||||
#endif // MSGPACK_OBJECT_HPP
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_OBJECT_DECL_HPP
|
||||
#define MSGPACK_OBJECT_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/object_decl.hpp"
|
||||
#include "msgpack/v2/object_decl.hpp"
|
||||
#include "msgpack/v3/object_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_OBJECT_DECL_HPP
|
|
@ -0,0 +1,20 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_OBJECT_FWD_HPP
|
||||
#define MSGPACK_OBJECT_FWD_HPP
|
||||
|
||||
#include "msgpack/object_fwd_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/object_fwd.hpp"
|
||||
#include "msgpack/v2/object_fwd.hpp"
|
||||
#include "msgpack/v3/object_fwd.hpp"
|
||||
|
||||
#endif // MSGPACK_OBJECT_FWD_HPP
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_OBJECT_FWD_DECL_HPP
|
||||
#define MSGPACK_OBJECT_FWD_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/object_fwd_decl.hpp"
|
||||
#include "msgpack/v2/object_fwd_decl.hpp"
|
||||
#include "msgpack/v3/object_fwd_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_OBJECT_FWD_DECL_HPP
|
|
@ -0,0 +1,151 @@
|
|||
/*
|
||||
* MessagePack for C packing routine
|
||||
*
|
||||
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef MSGPACK_PACK_H
|
||||
#define MSGPACK_PACK_H
|
||||
|
||||
#include "pack_define.h"
|
||||
#include "object.h"
|
||||
#include "timestamp.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup msgpack_buffer Buffers
|
||||
* @ingroup msgpack
|
||||
* @{
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup msgpack_pack Serializer
|
||||
* @ingroup msgpack
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef int (*msgpack_packer_write)(void* data, const char* buf, size_t len);
|
||||
|
||||
typedef struct msgpack_packer {
|
||||
void* data;
|
||||
msgpack_packer_write callback;
|
||||
} msgpack_packer;
|
||||
|
||||
static void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback);
|
||||
|
||||
static msgpack_packer* msgpack_packer_new(void* data, msgpack_packer_write callback);
|
||||
static void msgpack_packer_free(msgpack_packer* pk);
|
||||
|
||||
static int msgpack_pack_char(msgpack_packer* pk, char d);
|
||||
|
||||
static int msgpack_pack_signed_char(msgpack_packer* pk, signed char d);
|
||||
static int msgpack_pack_short(msgpack_packer* pk, short d);
|
||||
static int msgpack_pack_int(msgpack_packer* pk, int d);
|
||||
static int msgpack_pack_long(msgpack_packer* pk, long d);
|
||||
static int msgpack_pack_long_long(msgpack_packer* pk, long long d);
|
||||
static int msgpack_pack_unsigned_char(msgpack_packer* pk, unsigned char d);
|
||||
static int msgpack_pack_unsigned_short(msgpack_packer* pk, unsigned short d);
|
||||
static int msgpack_pack_unsigned_int(msgpack_packer* pk, unsigned int d);
|
||||
static int msgpack_pack_unsigned_long(msgpack_packer* pk, unsigned long d);
|
||||
static int msgpack_pack_unsigned_long_long(msgpack_packer* pk, unsigned long long d);
|
||||
|
||||
static int msgpack_pack_uint8(msgpack_packer* pk, uint8_t d);
|
||||
static int msgpack_pack_uint16(msgpack_packer* pk, uint16_t d);
|
||||
static int msgpack_pack_uint32(msgpack_packer* pk, uint32_t d);
|
||||
static int msgpack_pack_uint64(msgpack_packer* pk, uint64_t d);
|
||||
static int msgpack_pack_int8(msgpack_packer* pk, int8_t d);
|
||||
static int msgpack_pack_int16(msgpack_packer* pk, int16_t d);
|
||||
static int msgpack_pack_int32(msgpack_packer* pk, int32_t d);
|
||||
static int msgpack_pack_int64(msgpack_packer* pk, int64_t d);
|
||||
|
||||
static int msgpack_pack_fix_uint8(msgpack_packer* pk, uint8_t d);
|
||||
static int msgpack_pack_fix_uint16(msgpack_packer* pk, uint16_t d);
|
||||
static int msgpack_pack_fix_uint32(msgpack_packer* pk, uint32_t d);
|
||||
static int msgpack_pack_fix_uint64(msgpack_packer* pk, uint64_t d);
|
||||
static int msgpack_pack_fix_int8(msgpack_packer* pk, int8_t d);
|
||||
static int msgpack_pack_fix_int16(msgpack_packer* pk, int16_t d);
|
||||
static int msgpack_pack_fix_int32(msgpack_packer* pk, int32_t d);
|
||||
static int msgpack_pack_fix_int64(msgpack_packer* pk, int64_t d);
|
||||
|
||||
static int msgpack_pack_float(msgpack_packer* pk, float d);
|
||||
static int msgpack_pack_double(msgpack_packer* pk, double d);
|
||||
|
||||
static int msgpack_pack_nil(msgpack_packer* pk);
|
||||
static int msgpack_pack_true(msgpack_packer* pk);
|
||||
static int msgpack_pack_false(msgpack_packer* pk);
|
||||
|
||||
static int msgpack_pack_array(msgpack_packer* pk, size_t n);
|
||||
|
||||
static int msgpack_pack_map(msgpack_packer* pk, size_t n);
|
||||
|
||||
static int msgpack_pack_str(msgpack_packer* pk, size_t l);
|
||||
static int msgpack_pack_str_body(msgpack_packer* pk, const void* b, size_t l);
|
||||
|
||||
static int msgpack_pack_v4raw(msgpack_packer* pk, size_t l);
|
||||
static int msgpack_pack_v4raw_body(msgpack_packer* pk, const void* b, size_t l);
|
||||
|
||||
static int msgpack_pack_bin(msgpack_packer* pk, size_t l);
|
||||
static int msgpack_pack_bin_body(msgpack_packer* pk, const void* b, size_t l);
|
||||
|
||||
static int msgpack_pack_ext(msgpack_packer* pk, size_t l, int8_t type);
|
||||
static int msgpack_pack_ext_body(msgpack_packer* pk, const void* b, size_t l);
|
||||
|
||||
static int msgpack_pack_timestamp(msgpack_packer* pk, const msgpack_timestamp* d);
|
||||
|
||||
MSGPACK_DLLEXPORT
|
||||
int msgpack_pack_object(msgpack_packer* pk, msgpack_object d);
|
||||
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
#define msgpack_pack_inline_func(name) \
|
||||
inline int msgpack_pack ## name
|
||||
|
||||
#define msgpack_pack_inline_func_cint(name) \
|
||||
inline int msgpack_pack ## name
|
||||
|
||||
#define msgpack_pack_inline_func_fixint(name) \
|
||||
inline int msgpack_pack_fix ## name
|
||||
|
||||
#define msgpack_pack_user msgpack_packer*
|
||||
|
||||
#define msgpack_pack_append_buffer(user, buf, len) \
|
||||
return (*(user)->callback)((user)->data, (const char*)buf, len)
|
||||
|
||||
#include "pack_template.h"
|
||||
|
||||
inline void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback)
|
||||
{
|
||||
pk->data = data;
|
||||
pk->callback = callback;
|
||||
}
|
||||
|
||||
inline msgpack_packer* msgpack_packer_new(void* data, msgpack_packer_write callback)
|
||||
{
|
||||
msgpack_packer* pk = (msgpack_packer*)calloc(1, sizeof(msgpack_packer));
|
||||
if(!pk) { return NULL; }
|
||||
msgpack_packer_init(pk, data, callback);
|
||||
return pk;
|
||||
}
|
||||
|
||||
inline void msgpack_packer_free(msgpack_packer* pk)
|
||||
{
|
||||
free(pk);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* msgpack/pack.h */
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ serializing routine
|
||||
//
|
||||
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_PACK_HPP
|
||||
#define MSGPACK_PACK_HPP
|
||||
|
||||
#include "msgpack/pack_decl.hpp"
|
||||
|
||||
#include "msgpack/v1/pack.hpp"
|
||||
|
||||
#endif // MSGPACK_PACK_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ serializing routine
|
||||
//
|
||||
// Copyright (C) 2016 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_PACK_DECL_HPP
|
||||
#define MSGPACK_PACK_DECL_HPP
|
||||
|
||||
#include "msgpack/v1/pack_decl.hpp"
|
||||
#include "msgpack/v2/pack_decl.hpp"
|
||||
#include "msgpack/v3/pack_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_PACK_DECL_HPP
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* MessagePack unpacking routine template
|
||||
*
|
||||
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef MSGPACK_PACK_DEFINE_H
|
||||
#define MSGPACK_PACK_DEFINE_H
|
||||
|
||||
#include "msgpack/sysdep.h"
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#endif /* msgpack/pack_define.h */
|
||||
|
|
@ -0,0 +1,937 @@
|
|||
/*
|
||||
* MessagePack packing routine template
|
||||
*
|
||||
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#if MSGPACK_ENDIAN_LITTLE_BYTE
|
||||
#define TAKE8_8(d) ((uint8_t*)&d)[0]
|
||||
#define TAKE8_16(d) ((uint8_t*)&d)[0]
|
||||
#define TAKE8_32(d) ((uint8_t*)&d)[0]
|
||||
#define TAKE8_64(d) ((uint8_t*)&d)[0]
|
||||
#elif MSGPACK_ENDIAN_BIG_BYTE
|
||||
#define TAKE8_8(d) ((uint8_t*)&d)[0]
|
||||
#define TAKE8_16(d) ((uint8_t*)&d)[1]
|
||||
#define TAKE8_32(d) ((uint8_t*)&d)[3]
|
||||
#define TAKE8_64(d) ((uint8_t*)&d)[7]
|
||||
#else
|
||||
#error msgpack-c supports only big endian and little endian
|
||||
#endif
|
||||
|
||||
#ifndef msgpack_pack_inline_func
|
||||
#error msgpack_pack_inline_func template is not defined
|
||||
#endif
|
||||
|
||||
#ifndef msgpack_pack_user
|
||||
#error msgpack_pack_user type is not defined
|
||||
#endif
|
||||
|
||||
#ifndef msgpack_pack_append_buffer
|
||||
#error msgpack_pack_append_buffer callback is not defined
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Integer
|
||||
*/
|
||||
|
||||
#define msgpack_pack_real_uint8(x, d) \
|
||||
do { \
|
||||
if(d < (1<<7)) { \
|
||||
/* fixnum */ \
|
||||
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); \
|
||||
} else { \
|
||||
/* unsigned 8 */ \
|
||||
unsigned char buf[2] = {0xcc, TAKE8_8(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define msgpack_pack_real_uint16(x, d) \
|
||||
do { \
|
||||
if(d < (1<<7)) { \
|
||||
/* fixnum */ \
|
||||
msgpack_pack_append_buffer(x, &TAKE8_16(d), 1); \
|
||||
} else if(d < (1<<8)) { \
|
||||
/* unsigned 8 */ \
|
||||
unsigned char buf[2] = {0xcc, TAKE8_16(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} else { \
|
||||
/* unsigned 16 */ \
|
||||
unsigned char buf[3]; \
|
||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 3); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define msgpack_pack_real_uint32(x, d) \
|
||||
do { \
|
||||
if(d < (1<<8)) { \
|
||||
if(d < (1<<7)) { \
|
||||
/* fixnum */ \
|
||||
msgpack_pack_append_buffer(x, &TAKE8_32(d), 1); \
|
||||
} else { \
|
||||
/* unsigned 8 */ \
|
||||
unsigned char buf[2] = {0xcc, TAKE8_32(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} \
|
||||
} else { \
|
||||
if(d < (1<<16)) { \
|
||||
/* unsigned 16 */ \
|
||||
unsigned char buf[3]; \
|
||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 3); \
|
||||
} else { \
|
||||
/* unsigned 32 */ \
|
||||
unsigned char buf[5]; \
|
||||
buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 5); \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define msgpack_pack_real_uint64(x, d) \
|
||||
do { \
|
||||
if(d < (1ULL<<8)) { \
|
||||
if(d < (1ULL<<7)) { \
|
||||
/* fixnum */ \
|
||||
msgpack_pack_append_buffer(x, &TAKE8_64(d), 1); \
|
||||
} else { \
|
||||
/* unsigned 8 */ \
|
||||
unsigned char buf[2] = {0xcc, TAKE8_64(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} \
|
||||
} else { \
|
||||
if(d < (1ULL<<16)) { \
|
||||
/* unsigned 16 */ \
|
||||
unsigned char buf[3]; \
|
||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 3); \
|
||||
} else if(d < (1ULL<<32)) { \
|
||||
/* unsigned 32 */ \
|
||||
unsigned char buf[5]; \
|
||||
buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 5); \
|
||||
} else { \
|
||||
/* unsigned 64 */ \
|
||||
unsigned char buf[9]; \
|
||||
buf[0] = 0xcf; _msgpack_store64(&buf[1], d); \
|
||||
msgpack_pack_append_buffer(x, buf, 9); \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define msgpack_pack_real_int8(x, d) \
|
||||
do { \
|
||||
if(d < -(1<<5)) { \
|
||||
/* signed 8 */ \
|
||||
unsigned char buf[2] = {0xd0, TAKE8_8(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} else { \
|
||||
/* fixnum */ \
|
||||
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define msgpack_pack_real_int16(x, d) \
|
||||
do { \
|
||||
if(d < -(1<<5)) { \
|
||||
if(d < -(1<<7)) { \
|
||||
/* signed 16 */ \
|
||||
unsigned char buf[3]; \
|
||||
buf[0] = 0xd1; _msgpack_store16(&buf[1], (int16_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 3); \
|
||||
} else { \
|
||||
/* signed 8 */ \
|
||||
unsigned char buf[2] = {0xd0, TAKE8_16(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} \
|
||||
} else if(d < (1<<7)) { \
|
||||
/* fixnum */ \
|
||||
msgpack_pack_append_buffer(x, &TAKE8_16(d), 1); \
|
||||
} else { \
|
||||
if(d < (1<<8)) { \
|
||||
/* unsigned 8 */ \
|
||||
unsigned char buf[2] = {0xcc, TAKE8_16(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} else { \
|
||||
/* unsigned 16 */ \
|
||||
unsigned char buf[3]; \
|
||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 3); \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define msgpack_pack_real_int32(x, d) \
|
||||
do { \
|
||||
if(d < -(1<<5)) { \
|
||||
if(d < -(1<<15)) { \
|
||||
/* signed 32 */ \
|
||||
unsigned char buf[5]; \
|
||||
buf[0] = 0xd2; _msgpack_store32(&buf[1], (int32_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 5); \
|
||||
} else if(d < -(1<<7)) { \
|
||||
/* signed 16 */ \
|
||||
unsigned char buf[3]; \
|
||||
buf[0] = 0xd1; _msgpack_store16(&buf[1], (int16_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 3); \
|
||||
} else { \
|
||||
/* signed 8 */ \
|
||||
unsigned char buf[2] = {0xd0, TAKE8_32(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} \
|
||||
} else if(d < (1<<7)) { \
|
||||
/* fixnum */ \
|
||||
msgpack_pack_append_buffer(x, &TAKE8_32(d), 1); \
|
||||
} else { \
|
||||
if(d < (1<<8)) { \
|
||||
/* unsigned 8 */ \
|
||||
unsigned char buf[2] = {0xcc, TAKE8_32(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} else if(d < (1<<16)) { \
|
||||
/* unsigned 16 */ \
|
||||
unsigned char buf[3]; \
|
||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 3); \
|
||||
} else { \
|
||||
/* unsigned 32 */ \
|
||||
unsigned char buf[5]; \
|
||||
buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 5); \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define msgpack_pack_real_int64(x, d) \
|
||||
do { \
|
||||
if(d < -(1LL<<5)) { \
|
||||
if(d < -(1LL<<15)) { \
|
||||
if(d < -(1LL<<31)) { \
|
||||
/* signed 64 */ \
|
||||
unsigned char buf[9]; \
|
||||
buf[0] = 0xd3; _msgpack_store64(&buf[1], d); \
|
||||
msgpack_pack_append_buffer(x, buf, 9); \
|
||||
} else { \
|
||||
/* signed 32 */ \
|
||||
unsigned char buf[5]; \
|
||||
buf[0] = 0xd2; _msgpack_store32(&buf[1], (int32_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 5); \
|
||||
} \
|
||||
} else { \
|
||||
if(d < -(1<<7)) { \
|
||||
/* signed 16 */ \
|
||||
unsigned char buf[3]; \
|
||||
buf[0] = 0xd1; _msgpack_store16(&buf[1], (int16_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 3); \
|
||||
} else { \
|
||||
/* signed 8 */ \
|
||||
unsigned char buf[2] = {0xd0, TAKE8_64(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} \
|
||||
} \
|
||||
} else if(d < (1<<7)) { \
|
||||
/* fixnum */ \
|
||||
msgpack_pack_append_buffer(x, &TAKE8_64(d), 1); \
|
||||
} else { \
|
||||
if(d < (1LL<<16)) { \
|
||||
if(d < (1<<8)) { \
|
||||
/* unsigned 8 */ \
|
||||
unsigned char buf[2] = {0xcc, TAKE8_64(d)}; \
|
||||
msgpack_pack_append_buffer(x, buf, 2); \
|
||||
} else { \
|
||||
/* unsigned 16 */ \
|
||||
unsigned char buf[3]; \
|
||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 3); \
|
||||
} \
|
||||
} else { \
|
||||
if(d < (1LL<<32)) { \
|
||||
/* unsigned 32 */ \
|
||||
unsigned char buf[5]; \
|
||||
buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \
|
||||
msgpack_pack_append_buffer(x, buf, 5); \
|
||||
} else { \
|
||||
/* unsigned 64 */ \
|
||||
unsigned char buf[9]; \
|
||||
buf[0] = 0xcf; _msgpack_store64(&buf[1], d); \
|
||||
msgpack_pack_append_buffer(x, buf, 9); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
||||
#ifdef msgpack_pack_inline_func_fixint
|
||||
|
||||
msgpack_pack_inline_func_fixint(_uint8)(msgpack_pack_user x, uint8_t d)
|
||||
{
|
||||
unsigned char buf[2] = {0xcc, TAKE8_8(d)};
|
||||
msgpack_pack_append_buffer(x, buf, 2);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_fixint(_uint16)(msgpack_pack_user x, uint16_t d)
|
||||
{
|
||||
unsigned char buf[3];
|
||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], d);
|
||||
msgpack_pack_append_buffer(x, buf, 3);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_fixint(_uint32)(msgpack_pack_user x, uint32_t d)
|
||||
{
|
||||
unsigned char buf[5];
|
||||
buf[0] = 0xce; _msgpack_store32(&buf[1], d);
|
||||
msgpack_pack_append_buffer(x, buf, 5);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_fixint(_uint64)(msgpack_pack_user x, uint64_t d)
|
||||
{
|
||||
unsigned char buf[9];
|
||||
buf[0] = 0xcf; _msgpack_store64(&buf[1], d);
|
||||
msgpack_pack_append_buffer(x, buf, 9);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_fixint(_int8)(msgpack_pack_user x, int8_t d)
|
||||
{
|
||||
unsigned char buf[2] = {0xd0, TAKE8_8(d)};
|
||||
msgpack_pack_append_buffer(x, buf, 2);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_fixint(_int16)(msgpack_pack_user x, int16_t d)
|
||||
{
|
||||
unsigned char buf[3];
|
||||
buf[0] = 0xd1; _msgpack_store16(&buf[1], d);
|
||||
msgpack_pack_append_buffer(x, buf, 3);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_fixint(_int32)(msgpack_pack_user x, int32_t d)
|
||||
{
|
||||
unsigned char buf[5];
|
||||
buf[0] = 0xd2; _msgpack_store32(&buf[1], d);
|
||||
msgpack_pack_append_buffer(x, buf, 5);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_fixint(_int64)(msgpack_pack_user x, int64_t d)
|
||||
{
|
||||
unsigned char buf[9];
|
||||
buf[0] = 0xd3; _msgpack_store64(&buf[1], d);
|
||||
msgpack_pack_append_buffer(x, buf, 9);
|
||||
}
|
||||
|
||||
#undef msgpack_pack_inline_func_fixint
|
||||
#endif
|
||||
|
||||
|
||||
msgpack_pack_inline_func(_uint8)(msgpack_pack_user x, uint8_t d)
|
||||
{
|
||||
msgpack_pack_real_uint8(x, d);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_uint16)(msgpack_pack_user x, uint16_t d)
|
||||
{
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_uint32)(msgpack_pack_user x, uint32_t d)
|
||||
{
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_uint64)(msgpack_pack_user x, uint64_t d)
|
||||
{
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_int8)(msgpack_pack_user x, int8_t d)
|
||||
{
|
||||
msgpack_pack_real_int8(x, d);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_int16)(msgpack_pack_user x, int16_t d)
|
||||
{
|
||||
msgpack_pack_real_int16(x, d);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_int32)(msgpack_pack_user x, int32_t d)
|
||||
{
|
||||
msgpack_pack_real_int32(x, d);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_int64)(msgpack_pack_user x, int64_t d)
|
||||
{
|
||||
msgpack_pack_real_int64(x, d);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_char)(msgpack_pack_user x, char d)
|
||||
{
|
||||
#if defined(CHAR_MIN)
|
||||
#if CHAR_MIN < 0
|
||||
msgpack_pack_real_int8(x, d);
|
||||
#else
|
||||
msgpack_pack_real_uint8(x, d);
|
||||
#endif
|
||||
#else
|
||||
#error CHAR_MIN is not defined
|
||||
#endif
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_signed_char)(msgpack_pack_user x, signed char d)
|
||||
{
|
||||
msgpack_pack_real_int8(x, d);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_unsigned_char)(msgpack_pack_user x, unsigned char d)
|
||||
{
|
||||
msgpack_pack_real_uint8(x, d);
|
||||
}
|
||||
|
||||
#ifdef msgpack_pack_inline_func_cint
|
||||
|
||||
msgpack_pack_inline_func_cint(_short)(msgpack_pack_user x, short d)
|
||||
{
|
||||
#if defined(SIZEOF_SHORT)
|
||||
#if SIZEOF_SHORT == 2
|
||||
msgpack_pack_real_int16(x, d);
|
||||
#elif SIZEOF_SHORT == 4
|
||||
msgpack_pack_real_int32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_int64(x, d);
|
||||
#endif
|
||||
|
||||
#elif defined(SHRT_MAX)
|
||||
#if SHRT_MAX == 0x7fff
|
||||
msgpack_pack_real_int16(x, d);
|
||||
#elif SHRT_MAX == 0x7fffffff
|
||||
msgpack_pack_real_int32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_int64(x, d);
|
||||
#endif
|
||||
|
||||
#else
|
||||
if(sizeof(short) == 2) {
|
||||
msgpack_pack_real_int16(x, d);
|
||||
} else if(sizeof(short) == 4) {
|
||||
msgpack_pack_real_int32(x, d);
|
||||
} else {
|
||||
msgpack_pack_real_int64(x, d);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_cint(_int)(msgpack_pack_user x, int d)
|
||||
{
|
||||
#if defined(SIZEOF_INT)
|
||||
#if SIZEOF_INT == 2
|
||||
msgpack_pack_real_int16(x, d);
|
||||
#elif SIZEOF_INT == 4
|
||||
msgpack_pack_real_int32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_int64(x, d);
|
||||
#endif
|
||||
|
||||
#elif defined(INT_MAX)
|
||||
#if INT_MAX == 0x7fff
|
||||
msgpack_pack_real_int16(x, d);
|
||||
#elif INT_MAX == 0x7fffffff
|
||||
msgpack_pack_real_int32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_int64(x, d);
|
||||
#endif
|
||||
|
||||
#else
|
||||
if(sizeof(int) == 2) {
|
||||
msgpack_pack_real_int16(x, d);
|
||||
} else if(sizeof(int) == 4) {
|
||||
msgpack_pack_real_int32(x, d);
|
||||
} else {
|
||||
msgpack_pack_real_int64(x, d);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_cint(_long)(msgpack_pack_user x, long d)
|
||||
{
|
||||
#if defined(SIZEOF_LONG)
|
||||
#if SIZEOF_LONG == 2
|
||||
msgpack_pack_real_int16(x, d);
|
||||
#elif SIZEOF_LONG == 4
|
||||
msgpack_pack_real_int32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_int64(x, d);
|
||||
#endif
|
||||
|
||||
#elif defined(LONG_MAX)
|
||||
#if LONG_MAX == 0x7fffL
|
||||
msgpack_pack_real_int16(x, d);
|
||||
#elif LONG_MAX == 0x7fffffffL
|
||||
msgpack_pack_real_int32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_int64(x, d);
|
||||
#endif
|
||||
|
||||
#else
|
||||
if(sizeof(long) == 2) {
|
||||
msgpack_pack_real_int16(x, d);
|
||||
} else if(sizeof(long) == 4) {
|
||||
msgpack_pack_real_int32(x, d);
|
||||
} else {
|
||||
msgpack_pack_real_int64(x, d);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_cint(_long_long)(msgpack_pack_user x, long long d)
|
||||
{
|
||||
#if defined(SIZEOF_LONG_LONG)
|
||||
#if SIZEOF_LONG_LONG == 2
|
||||
msgpack_pack_real_int16(x, d);
|
||||
#elif SIZEOF_LONG_LONG == 4
|
||||
msgpack_pack_real_int32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_int64(x, d);
|
||||
#endif
|
||||
|
||||
#elif defined(LLONG_MAX)
|
||||
#if LLONG_MAX == 0x7fffL
|
||||
msgpack_pack_real_int16(x, d);
|
||||
#elif LLONG_MAX == 0x7fffffffL
|
||||
msgpack_pack_real_int32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_int64(x, d);
|
||||
#endif
|
||||
|
||||
#else
|
||||
if(sizeof(long long) == 2) {
|
||||
msgpack_pack_real_int16(x, d);
|
||||
} else if(sizeof(long long) == 4) {
|
||||
msgpack_pack_real_int32(x, d);
|
||||
} else {
|
||||
msgpack_pack_real_int64(x, d);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_cint(_unsigned_short)(msgpack_pack_user x, unsigned short d)
|
||||
{
|
||||
#if defined(SIZEOF_SHORT)
|
||||
#if SIZEOF_SHORT == 2
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
#elif SIZEOF_SHORT == 4
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
#endif
|
||||
|
||||
#elif defined(USHRT_MAX)
|
||||
#if USHRT_MAX == 0xffffU
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
#elif USHRT_MAX == 0xffffffffU
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
#endif
|
||||
|
||||
#else
|
||||
if(sizeof(unsigned short) == 2) {
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
} else if(sizeof(unsigned short) == 4) {
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
} else {
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_cint(_unsigned_int)(msgpack_pack_user x, unsigned int d)
|
||||
{
|
||||
#if defined(SIZEOF_INT)
|
||||
#if SIZEOF_INT == 2
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
#elif SIZEOF_INT == 4
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
#endif
|
||||
|
||||
#elif defined(UINT_MAX)
|
||||
#if UINT_MAX == 0xffffU
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
#elif UINT_MAX == 0xffffffffU
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
#endif
|
||||
|
||||
#else
|
||||
if(sizeof(unsigned int) == 2) {
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
} else if(sizeof(unsigned int) == 4) {
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
} else {
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_cint(_unsigned_long)(msgpack_pack_user x, unsigned long d)
|
||||
{
|
||||
#if defined(SIZEOF_LONG)
|
||||
#if SIZEOF_LONG == 2
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
#elif SIZEOF_LONG == 4
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
#endif
|
||||
|
||||
#elif defined(ULONG_MAX)
|
||||
#if ULONG_MAX == 0xffffUL
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
#elif ULONG_MAX == 0xffffffffUL
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
#endif
|
||||
|
||||
#else
|
||||
if(sizeof(unsigned long) == 2) {
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
} else if(sizeof(unsigned long) == 4) {
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
} else {
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func_cint(_unsigned_long_long)(msgpack_pack_user x, unsigned long long d)
|
||||
{
|
||||
#if defined(SIZEOF_LONG_LONG)
|
||||
#if SIZEOF_LONG_LONG == 2
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
#elif SIZEOF_LONG_LONG == 4
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
#endif
|
||||
|
||||
#elif defined(ULLONG_MAX)
|
||||
#if ULLONG_MAX == 0xffffUL
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
#elif ULLONG_MAX == 0xffffffffUL
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
#else
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
#endif
|
||||
|
||||
#else
|
||||
if(sizeof(unsigned long long) == 2) {
|
||||
msgpack_pack_real_uint16(x, d);
|
||||
} else if(sizeof(unsigned long long) == 4) {
|
||||
msgpack_pack_real_uint32(x, d);
|
||||
} else {
|
||||
msgpack_pack_real_uint64(x, d);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef msgpack_pack_inline_func_cint
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Float
|
||||
*/
|
||||
|
||||
msgpack_pack_inline_func(_float)(msgpack_pack_user x, float d)
|
||||
{
|
||||
unsigned char buf[5];
|
||||
union { float f; uint32_t i; } mem;
|
||||
mem.f = d;
|
||||
buf[0] = 0xca; _msgpack_store32(&buf[1], mem.i);
|
||||
msgpack_pack_append_buffer(x, buf, 5);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_double)(msgpack_pack_user x, double d)
|
||||
{
|
||||
unsigned char buf[9];
|
||||
union { double f; uint64_t i; } mem;
|
||||
mem.f = d;
|
||||
buf[0] = 0xcb;
|
||||
#if defined(TARGET_OS_IPHONE)
|
||||
// ok
|
||||
#elif defined(__arm__) && !(__ARM_EABI__) // arm-oabi
|
||||
// https://github.com/msgpack/msgpack-perl/pull/1
|
||||
mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
|
||||
#endif
|
||||
_msgpack_store64(&buf[1], mem.i);
|
||||
msgpack_pack_append_buffer(x, buf, 9);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Nil
|
||||
*/
|
||||
|
||||
msgpack_pack_inline_func(_nil)(msgpack_pack_user x)
|
||||
{
|
||||
static const unsigned char d = 0xc0;
|
||||
msgpack_pack_append_buffer(x, &d, 1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Boolean
|
||||
*/
|
||||
|
||||
msgpack_pack_inline_func(_true)(msgpack_pack_user x)
|
||||
{
|
||||
static const unsigned char d = 0xc3;
|
||||
msgpack_pack_append_buffer(x, &d, 1);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_false)(msgpack_pack_user x)
|
||||
{
|
||||
static const unsigned char d = 0xc2;
|
||||
msgpack_pack_append_buffer(x, &d, 1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Array
|
||||
*/
|
||||
|
||||
msgpack_pack_inline_func(_array)(msgpack_pack_user x, size_t n)
|
||||
{
|
||||
if(n < 16) {
|
||||
unsigned char d = 0x90 | (uint8_t)n;
|
||||
msgpack_pack_append_buffer(x, &d, 1);
|
||||
} else if(n < 65536) {
|
||||
unsigned char buf[3];
|
||||
buf[0] = 0xdc; _msgpack_store16(&buf[1], (uint16_t)n);
|
||||
msgpack_pack_append_buffer(x, buf, 3);
|
||||
} else {
|
||||
unsigned char buf[5];
|
||||
buf[0] = 0xdd; _msgpack_store32(&buf[1], (uint32_t)n);
|
||||
msgpack_pack_append_buffer(x, buf, 5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Map
|
||||
*/
|
||||
|
||||
msgpack_pack_inline_func(_map)(msgpack_pack_user x, size_t n)
|
||||
{
|
||||
if(n < 16) {
|
||||
unsigned char d = 0x80 | (uint8_t)n;
|
||||
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1);
|
||||
} else if(n < 65536) {
|
||||
unsigned char buf[3];
|
||||
buf[0] = 0xde; _msgpack_store16(&buf[1], (uint16_t)n);
|
||||
msgpack_pack_append_buffer(x, buf, 3);
|
||||
} else {
|
||||
unsigned char buf[5];
|
||||
buf[0] = 0xdf; _msgpack_store32(&buf[1], (uint32_t)n);
|
||||
msgpack_pack_append_buffer(x, buf, 5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Str
|
||||
*/
|
||||
|
||||
msgpack_pack_inline_func(_str)(msgpack_pack_user x, size_t l)
|
||||
{
|
||||
if(l < 32) {
|
||||
unsigned char d = 0xa0 | (uint8_t)l;
|
||||
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1);
|
||||
} else if(l < 256) {
|
||||
unsigned char buf[2];
|
||||
buf[0] = 0xd9; buf[1] = (uint8_t)l;
|
||||
msgpack_pack_append_buffer(x, buf, 2);
|
||||
} else if(l < 65536) {
|
||||
unsigned char buf[3];
|
||||
buf[0] = 0xda; _msgpack_store16(&buf[1], (uint16_t)l);
|
||||
msgpack_pack_append_buffer(x, buf, 3);
|
||||
} else {
|
||||
unsigned char buf[5];
|
||||
buf[0] = 0xdb; _msgpack_store32(&buf[1], (uint32_t)l);
|
||||
msgpack_pack_append_buffer(x, buf, 5);
|
||||
}
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_str_body)(msgpack_pack_user x, const void* b, size_t l)
|
||||
{
|
||||
msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
|
||||
}
|
||||
|
||||
/*
|
||||
* Raw (V4)
|
||||
*/
|
||||
|
||||
msgpack_pack_inline_func(_v4raw)(msgpack_pack_user x, size_t l)
|
||||
{
|
||||
if(l < 32) {
|
||||
unsigned char d = 0xa0 | (uint8_t)l;
|
||||
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1);
|
||||
} else if(l < 65536) {
|
||||
unsigned char buf[3];
|
||||
buf[0] = 0xda; _msgpack_store16(&buf[1], (uint16_t)l);
|
||||
msgpack_pack_append_buffer(x, buf, 3);
|
||||
} else {
|
||||
unsigned char buf[5];
|
||||
buf[0] = 0xdb; _msgpack_store32(&buf[1], (uint32_t)l);
|
||||
msgpack_pack_append_buffer(x, buf, 5);
|
||||
}
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_v4raw_body)(msgpack_pack_user x, const void* b, size_t l)
|
||||
{
|
||||
msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
|
||||
}
|
||||
|
||||
/*
|
||||
* Bin
|
||||
*/
|
||||
|
||||
msgpack_pack_inline_func(_bin)(msgpack_pack_user x, size_t l)
|
||||
{
|
||||
if(l < 256) {
|
||||
unsigned char buf[2];
|
||||
buf[0] = 0xc4; buf[1] = (uint8_t)l;
|
||||
msgpack_pack_append_buffer(x, buf, 2);
|
||||
} else if(l < 65536) {
|
||||
unsigned char buf[3];
|
||||
buf[0] = 0xc5; _msgpack_store16(&buf[1], (uint16_t)l);
|
||||
msgpack_pack_append_buffer(x, buf, 3);
|
||||
} else {
|
||||
unsigned char buf[5];
|
||||
buf[0] = 0xc6; _msgpack_store32(&buf[1], (uint32_t)l);
|
||||
msgpack_pack_append_buffer(x, buf, 5);
|
||||
}
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_bin_body)(msgpack_pack_user x, const void* b, size_t l)
|
||||
{
|
||||
msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
|
||||
}
|
||||
|
||||
/*
|
||||
* Ext
|
||||
*/
|
||||
|
||||
msgpack_pack_inline_func(_ext)(msgpack_pack_user x, size_t l, int8_t type)
|
||||
{
|
||||
switch(l) {
|
||||
case 1: {
|
||||
unsigned char buf[2];
|
||||
buf[0] = 0xd4;
|
||||
buf[1] = type;
|
||||
msgpack_pack_append_buffer(x, buf, 2);
|
||||
} break;
|
||||
case 2: {
|
||||
unsigned char buf[2];
|
||||
buf[0] = 0xd5;
|
||||
buf[1] = type;
|
||||
msgpack_pack_append_buffer(x, buf, 2);
|
||||
} break;
|
||||
case 4: {
|
||||
unsigned char buf[2];
|
||||
buf[0] = 0xd6;
|
||||
buf[1] = type;
|
||||
msgpack_pack_append_buffer(x, buf, 2);
|
||||
} break;
|
||||
case 8: {
|
||||
unsigned char buf[2];
|
||||
buf[0] = 0xd7;
|
||||
buf[1] = type;
|
||||
msgpack_pack_append_buffer(x, buf, 2);
|
||||
} break;
|
||||
case 16: {
|
||||
unsigned char buf[2];
|
||||
buf[0] = 0xd8;
|
||||
buf[1] = type;
|
||||
msgpack_pack_append_buffer(x, buf, 2);
|
||||
} break;
|
||||
default:
|
||||
if(l < 256) {
|
||||
unsigned char buf[3];
|
||||
buf[0] = 0xc7;
|
||||
buf[1] = (unsigned char)l;
|
||||
buf[2] = type;
|
||||
msgpack_pack_append_buffer(x, buf, 3);
|
||||
} else if(l < 65536) {
|
||||
unsigned char buf[4];
|
||||
buf[0] = 0xc8;
|
||||
_msgpack_store16(&buf[1], l);
|
||||
buf[3] = type;
|
||||
msgpack_pack_append_buffer(x, buf, 4);
|
||||
} else {
|
||||
unsigned char buf[6];
|
||||
buf[0] = 0xc9;
|
||||
_msgpack_store32(&buf[1], l);
|
||||
buf[5] = type;
|
||||
msgpack_pack_append_buffer(x, buf, 6);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_ext_body)(msgpack_pack_user x, const void* b, size_t l)
|
||||
{
|
||||
msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
|
||||
}
|
||||
|
||||
msgpack_pack_inline_func(_timestamp)(msgpack_pack_user x, const msgpack_timestamp* d)
|
||||
{
|
||||
if ((((int64_t)d->tv_sec) >> 34) == 0) {
|
||||
uint64_t data64 = ((uint64_t) d->tv_nsec << 34) | d->tv_sec;
|
||||
if ((data64 & 0xffffffff00000000L) == 0) {
|
||||
// timestamp 32
|
||||
char buf[4];
|
||||
uint32_t data32 = (uint32_t)data64;
|
||||
msgpack_pack_ext(x, 4, -1);
|
||||
_msgpack_store32(buf, data32);
|
||||
msgpack_pack_append_buffer(x, buf, 4);
|
||||
} else {
|
||||
// timestamp 64
|
||||
char buf[8];
|
||||
msgpack_pack_ext(x, 8, -1);
|
||||
_msgpack_store64(buf, data64);
|
||||
msgpack_pack_append_buffer(x, buf, 8);
|
||||
}
|
||||
} else {
|
||||
// timestamp 96
|
||||
char buf[12];
|
||||
_msgpack_store32(&buf[0], d->tv_nsec);
|
||||
_msgpack_store64(&buf[4], d->tv_sec);
|
||||
msgpack_pack_ext(x, 12, -1);
|
||||
msgpack_pack_append_buffer(x, buf, 12);
|
||||
}
|
||||
}
|
||||
|
||||
#undef msgpack_pack_inline_func
|
||||
#undef msgpack_pack_user
|
||||
#undef msgpack_pack_append_buffer
|
||||
|
||||
#undef TAKE8_8
|
||||
#undef TAKE8_16
|
||||
#undef TAKE8_32
|
||||
#undef TAKE8_64
|
||||
|
||||
#undef msgpack_pack_real_uint8
|
||||
#undef msgpack_pack_real_uint16
|
||||
#undef msgpack_pack_real_uint32
|
||||
#undef msgpack_pack_real_uint64
|
||||
#undef msgpack_pack_real_int8
|
||||
#undef msgpack_pack_real_int16
|
||||
#undef msgpack_pack_real_int32
|
||||
#undef msgpack_pack_real_int64
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// MessagePack for C++ deserializing routine
|
||||
//
|
||||
// Copyright (C) 2018 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_PARSE_HPP
|
||||
#define MSGPACK_PARSE_HPP
|
||||
|
||||
#include "msgpack/parse_decl.hpp"
|
||||
|
||||
#include "msgpack/v2/parse.hpp"
|
||||
#include "msgpack/v3/parse.hpp"
|
||||
|
||||
#endif // MSGPACK_PARSE_HPP
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// MessagePack for C++ deserializing routine
|
||||
//
|
||||
// Copyright (C) 2018 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_PARSE_DECL_HPP
|
||||
#define MSGPACK_PARSE_DECL_HPP
|
||||
|
||||
#include "msgpack/v2/parse_decl.hpp"
|
||||
#include "msgpack/v3/parse_decl.hpp"
|
||||
|
||||
#endif // MSGPACK_PARSE_DECL_HPP
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MessagePack for C++ deserializing routine
|
||||
//
|
||||
// Copyright (C) 2017 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_PARSE_RETURN_HPP
|
||||
#define MSGPACK_PARSE_RETURN_HPP
|
||||
|
||||
#include "msgpack/v1/parse_return.hpp"
|
||||
#include "msgpack/v2/parse_return.hpp"
|
||||
#include "msgpack/v3/parse_return.hpp"
|
||||
|
||||
#endif // MSGPACK_PARSE_RETURN_HPP
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
Copyright Rene Rivera 2008-2015
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#if !defined(MSGPACK_PREDEF_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS)
|
||||
#ifndef MSGPACK_PREDEF_H
|
||||
#define MSGPACK_PREDEF_H
|
||||
#endif
|
||||
|
||||
#include <msgpack/predef/language.h>
|
||||
#include <msgpack/predef/architecture.h>
|
||||
#include <msgpack/predef/compiler.h>
|
||||
#include <msgpack/predef/library.h>
|
||||
#include <msgpack/predef/os.h>
|
||||
#include <msgpack/predef/other.h>
|
||||
#include <msgpack/predef/platform.h>
|
||||
#include <msgpack/predef/hardware.h>
|
||||
|
||||
#include <msgpack/predef/version.h>
|
||||
|
||||
#endif
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
Copyright Rene Rivera 2008-2015
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#if !defined(MSGPACK_PREDEF_ARCHITECTURE_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS)
|
||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_H
|
||||
#define MSGPACK_PREDEF_ARCHITECTURE_H
|
||||
#endif
|
||||
|
||||
#include <msgpack/predef/architecture/alpha.h>
|
||||
#include <msgpack/predef/architecture/arm.h>
|
||||
#include <msgpack/predef/architecture/blackfin.h>
|
||||
#include <msgpack/predef/architecture/convex.h>
|
||||
#include <msgpack/predef/architecture/ia64.h>
|
||||
#include <msgpack/predef/architecture/m68k.h>
|
||||
#include <msgpack/predef/architecture/mips.h>
|
||||
#include <msgpack/predef/architecture/parisc.h>
|
||||
#include <msgpack/predef/architecture/ppc.h>
|
||||
#include <msgpack/predef/architecture/pyramid.h>
|
||||
#include <msgpack/predef/architecture/rs6k.h>
|
||||
#include <msgpack/predef/architecture/sparc.h>
|
||||
#include <msgpack/predef/architecture/superh.h>
|
||||
#include <msgpack/predef/architecture/sys370.h>
|
||||
#include <msgpack/predef/architecture/sys390.h>
|
||||
#include <msgpack/predef/architecture/x86.h>
|
||||
#include <msgpack/predef/architecture/z.h>
|
||||
/*#include <msgpack/predef/architecture/.h>*/
|
||||
|
||||
#endif
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
Copyright Rene Rivera 2008-2015
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_ALPHA_H
|
||||
#define MSGPACK_PREDEF_ARCHITECTURE_ALPHA_H
|
||||
|
||||
#include <msgpack/predef/version_number.h>
|
||||
#include <msgpack/predef/make.h>
|
||||
|
||||
/*`
|
||||
[heading `MSGPACK_ARCH_ALPHA`]
|
||||
|
||||
[@http://en.wikipedia.org/wiki/DEC_Alpha DEC Alpha] architecture.
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
[[`__alpha__`] [__predef_detection__]]
|
||||
[[`__alpha`] [__predef_detection__]]
|
||||
[[`_M_ALPHA`] [__predef_detection__]]
|
||||
|
||||
[[`__alpha_ev4__`] [4.0.0]]
|
||||
[[`__alpha_ev5__`] [5.0.0]]
|
||||
[[`__alpha_ev6__`] [6.0.0]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if defined(__alpha__) || defined(__alpha) || \
|
||||
defined(_M_ALPHA)
|
||||
# undef MSGPACK_ARCH_ALPHA
|
||||
# if !defined(MSGPACK_ARCH_ALPHA) && defined(__alpha_ev4__)
|
||||
# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER(4,0,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_ALPHA) && defined(__alpha_ev5__)
|
||||
# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER(5,0,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_ALPHA) && defined(__alpha_ev6__)
|
||||
# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER(6,0,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_ALPHA)
|
||||
# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER_AVAILABLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if MSGPACK_ARCH_ALPHA
|
||||
# define MSGPACK_ARCH_ALPHA_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define MSGPACK_ARCH_ALPHA_NAME "DEC Alpha"
|
||||
|
||||
#endif
|
||||
|
||||
#include <msgpack/predef/detail/test.h>
|
||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_ALPHA,MSGPACK_ARCH_ALPHA_NAME)
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
Copyright Rene Rivera 2008-2015
|
||||
Copyright Franz Detro 2014
|
||||
Copyright (c) Microsoft Corporation 2014
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_ARM_H
|
||||
#define MSGPACK_PREDEF_ARCHITECTURE_ARM_H
|
||||
|
||||
#include <msgpack/predef/version_number.h>
|
||||
#include <msgpack/predef/make.h>
|
||||
|
||||
/*`
|
||||
[heading `MSGPACK_ARCH_ARM`]
|
||||
|
||||
[@http://en.wikipedia.org/wiki/ARM_architecture ARM] architecture.
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
|
||||
[[`__arm__`] [__predef_detection__]]
|
||||
[[`__arm64`] [__predef_detection__]]
|
||||
[[`__thumb__`] [__predef_detection__]]
|
||||
[[`__TARGET_ARCH_ARM`] [__predef_detection__]]
|
||||
[[`__TARGET_ARCH_THUMB`] [__predef_detection__]]
|
||||
[[`_M_ARM`] [__predef_detection__]]
|
||||
|
||||
[[`__arm64`] [8.0.0]]
|
||||
[[`__TARGET_ARCH_ARM`] [V.0.0]]
|
||||
[[`__TARGET_ARCH_THUMB`] [V.0.0]]
|
||||
[[`_M_ARM`] [V.0.0]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if defined(__arm__) || defined(__arm64) || defined(__thumb__) || \
|
||||
defined(__TARGET_ARCH_ARM) || defined(__TARGET_ARCH_THUMB) || \
|
||||
defined(_M_ARM)
|
||||
# undef MSGPACK_ARCH_ARM
|
||||
# if !defined(MSGPACK_ARCH_ARM) && defined(__arm64)
|
||||
# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(8,0,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_ARM) && defined(__TARGET_ARCH_ARM)
|
||||
# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(__TARGET_ARCH_ARM,0,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_ARM) && defined(__TARGET_ARCH_THUMB)
|
||||
# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(__TARGET_ARCH_THUMB,0,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_ARM) && defined(_M_ARM)
|
||||
# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(_M_ARM,0,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_ARM)
|
||||
# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER_AVAILABLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if MSGPACK_ARCH_ARM
|
||||
# define MSGPACK_ARCH_ARM_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define MSGPACK_ARCH_ARM_NAME "ARM"
|
||||
|
||||
#endif
|
||||
|
||||
#include <msgpack/predef/detail/test.h>
|
||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_ARM,MSGPACK_ARCH_ARM_NAME)
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
Copyright Rene Rivera 2013-2015
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_BLACKFIN_H
|
||||
#define MSGPACK_PREDEF_ARCHITECTURE_BLACKFIN_H
|
||||
|
||||
#include <msgpack/predef/version_number.h>
|
||||
#include <msgpack/predef/make.h>
|
||||
|
||||
/*`
|
||||
[heading `MSGPACK_ARCH_BLACKFIN`]
|
||||
|
||||
Blackfin Processors from Analog Devices.
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
|
||||
[[`__bfin__`] [__predef_detection__]]
|
||||
[[`__BFIN__`] [__predef_detection__]]
|
||||
[[`bfin`] [__predef_detection__]]
|
||||
[[`BFIN`] [__predef_detection__]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define MSGPACK_ARCH_BLACKFIN MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if defined(__bfin__) || defined(__BFIN__) || \
|
||||
defined(bfin) || defined(BFIN)
|
||||
# undef MSGPACK_ARCH_BLACKFIN
|
||||
# define MSGPACK_ARCH_BLACKFIN MSGPACK_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if MSGPACK_ARCH_BLACKFIN
|
||||
# define MSGPACK_ARCH_BLACKFIN_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define MSGPACK_ARCH_BLACKFIN_NAME "Blackfin"
|
||||
|
||||
#endif
|
||||
|
||||
#include <msgpack/predef/detail/test.h>
|
||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_BLACKFIN,MSGPACK_ARCH_BLACKFIN_NAME)
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
Copyright Rene Rivera 2011-2015
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_CONVEX_H
|
||||
#define MSGPACK_PREDEF_ARCHITECTURE_CONVEX_H
|
||||
|
||||
#include <msgpack/predef/version_number.h>
|
||||
#include <msgpack/predef/make.h>
|
||||
|
||||
/*`
|
||||
[heading `MSGPACK_ARCH_CONVEX`]
|
||||
|
||||
[@http://en.wikipedia.org/wiki/Convex_Computer Convex Computer] architecture.
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
|
||||
[[`__convex__`] [__predef_detection__]]
|
||||
|
||||
[[`__convex_c1__`] [1.0.0]]
|
||||
[[`__convex_c2__`] [2.0.0]]
|
||||
[[`__convex_c32__`] [3.2.0]]
|
||||
[[`__convex_c34__`] [3.4.0]]
|
||||
[[`__convex_c38__`] [3.8.0]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if defined(__convex__)
|
||||
# undef MSGPACK_ARCH_CONVEX
|
||||
# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c1__)
|
||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(1,0,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c2__)
|
||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(2,0,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c32__)
|
||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(3,2,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c34__)
|
||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(3,4,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c38__)
|
||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(3,8,0)
|
||||
# endif
|
||||
# if !defined(MSGPACK_ARCH_CONVEX)
|
||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER_AVAILABLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if MSGPACK_ARCH_CONVEX
|
||||
# define MSGPACK_ARCH_CONVEX_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define MSGPACK_ARCH_CONVEX_NAME "Convex Computer"
|
||||
|
||||
#endif
|
||||
|
||||
#include <msgpack/predef/detail/test.h>
|
||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_CONVEX,MSGPACK_ARCH_CONVEX_NAME)
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче