mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-20 22:31:33 +02:00
Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
44c0f705c9 | ||
![]() |
ddb884e9cd | ||
![]() |
c593c32b87 | ||
![]() |
d812fa5edc | ||
![]() |
e9e06a546c | ||
![]() |
1021aeea6f | ||
![]() |
2c0040cef6 | ||
![]() |
f33c7dfdbe | ||
![]() |
d372a71786 | ||
![]() |
2987022c10 | ||
![]() |
34f531e26e | ||
![]() |
91006555f1 | ||
![]() |
cd7c5bcfec | ||
![]() |
add68ff9e6 | ||
![]() |
ede530de0a | ||
![]() |
62de80fa72 | ||
![]() |
f2b3f52d44 | ||
![]() |
035bfeb39e | ||
![]() |
04292fe63d | ||
![]() |
573ebca3d2 | ||
![]() |
37fcaa1264 | ||
![]() |
a55c73d90e | ||
![]() |
b2f056c8b6 | ||
![]() |
e7f7b51005 |
6
.github/depends/zlib.sh
vendored
6
.github/depends/zlib.sh
vendored
@@ -27,9 +27,9 @@ while getopts "b:t:p:" c; do
|
||||
done
|
||||
|
||||
mkdir $prefix || exit 1
|
||||
wget https://zlib.net/zlib-1.2.13.tar.gz || exit 1
|
||||
tar -xf zlib-1.2.13.tar.gz || exit 1
|
||||
cd zlib-1.2.13
|
||||
wget https://zlib.net/zlib-1.3.1.tar.gz || exit 1
|
||||
tar -xf zlib-1.3.1.tar.gz || exit 1
|
||||
cd zlib-1.3.1
|
||||
|
||||
build()
|
||||
{
|
||||
|
@@ -1,3 +1,8 @@
|
||||
# 2024-04-02 version 6.1.1
|
||||
* Fix compilation error when std::variant has the same types (#1112)
|
||||
* Improve CI (#1090, #1110)
|
||||
* Fix to avoid common function name's (has_as::check) ambiguity/conflict with other libraries' macros (#1085)
|
||||
|
||||
# 2023-07-08 version 6.1.0
|
||||
* Remove dependency on boost in chrono.hpp (#1076)
|
||||
* Add support for std::variant behavior (#1075)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
`msgpack` for C++
|
||||
===================
|
||||
|
||||
Version 6.1.0 [](https://github.com/msgpack/msgpack-c/actions) [](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/cpp_master)
|
||||
Version 6.1.1 [](https://github.com/msgpack/msgpack-c/actions) [](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/cpp_master)
|
||||
[](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master)
|
||||
|
||||
It's like JSON but smaller and faster.
|
||||
|
16
appveyor.yml
16
appveyor.yml
@@ -1,4 +1,4 @@
|
||||
version: 6.1.0.{build}
|
||||
version: 6.1.1.{build}
|
||||
|
||||
branches:
|
||||
only:
|
||||
@@ -23,10 +23,10 @@ environment:
|
||||
boost_subdir: lib32-msvc-14.0
|
||||
build_script:
|
||||
- ps: |
|
||||
appveyor DownloadFile http://zlib.net/zlib-1.2.13.tar.gz -FileName zlib-1.2.13.tar.gz
|
||||
7z x zlib-1.2.13.tar.gz 2> $null
|
||||
7z x zlib-1.2.13.tar 2> $null
|
||||
cd zlib-1.2.13
|
||||
appveyor DownloadFile http://zlib.net/zlib-1.3.1.tar.gz -FileName zlib-1.3.1.tar.gz
|
||||
7z x zlib-1.3.1.tar.gz 2> $null
|
||||
7z x zlib-1.3.1.tar 2> $null
|
||||
cd zlib-1.3.1
|
||||
|
||||
md build
|
||||
md prefix
|
||||
@@ -34,7 +34,7 @@ build_script:
|
||||
|
||||
cmake `
|
||||
-G $env:msvc `
|
||||
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.13\prefix" `
|
||||
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" `
|
||||
..
|
||||
if ($LastExitCode -ne 0) { exit $LastExitCode }
|
||||
|
||||
@@ -52,7 +52,7 @@ build_script:
|
||||
-D MSGPACK_BUILD_EXAMPLES=ON `
|
||||
-D MSGPACK_BUILD_TESTS=ON `
|
||||
-D CMAKE_EXE_LINKER_FLAGS=/LIBPATH:"$env:boost_prefix\$env:boost_subdir" `
|
||||
-D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.13\prefix" `
|
||||
-D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" `
|
||||
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" `
|
||||
-D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" `
|
||||
..
|
||||
@@ -62,5 +62,5 @@ build_script:
|
||||
if ($LastExitCode -ne 0) { exit $LastExitCode }
|
||||
|
||||
test_script:
|
||||
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.2.13\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir%
|
||||
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.3.1\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir%
|
||||
- ctest -VV -C Release
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FIND_PACKAGE (Boost REQUIRED COMPONENTS system)
|
||||
FIND_PACKAGE (Boost REQUIRED)
|
||||
FIND_PACKAGE (Threads REQUIRED)
|
||||
FIND_PACKAGE (ZLIB REQUIRED)
|
||||
|
||||
@@ -22,7 +22,6 @@ FOREACH (source_file ${exec_PROGRAMS})
|
||||
)
|
||||
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
|
||||
msgpack-cxx
|
||||
Boost::system
|
||||
Threads::Threads
|
||||
)
|
||||
IF (ZLIB_FOUND)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
|
||||
FIND_PACKAGE (Boost REQUIRED COMPONENTS context system)
|
||||
FIND_PACKAGE (Boost REQUIRED COMPONENTS context)
|
||||
FIND_PACKAGE (Threads REQUIRED)
|
||||
|
||||
LIST (APPEND exec_PROGRAMS
|
||||
@@ -42,7 +42,6 @@ IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
|
||||
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
|
||||
msgpack-cxx
|
||||
Boost::context
|
||||
Boost::system
|
||||
Threads::Threads
|
||||
)
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
|
@@ -1,5 +1,5 @@
|
||||
FIND_PACKAGE (Threads REQUIRED)
|
||||
FIND_PACKAGE (Boost REQUIRED COMPONENTS system filesystem unit_test_framework)
|
||||
FIND_PACKAGE (Boost REQUIRED COMPONENTS filesystem unit_test_framework)
|
||||
|
||||
LIST (APPEND check_PROGRAMS
|
||||
regression_runner.cpp
|
||||
@@ -19,7 +19,6 @@ FOREACH (source_file ${check_PROGRAMS})
|
||||
msgpack-cxx
|
||||
Threads::Threads
|
||||
Boost::filesystem
|
||||
Boost::system
|
||||
Boost::unit_test_framework
|
||||
)
|
||||
|
||||
|
@@ -40,11 +40,11 @@ Variant construct_variant(
|
||||
std::index_sequence<current_index, indices...>
|
||||
) {
|
||||
if constexpr(sizeof...(Ts) == 0) {
|
||||
return object.as<T>();
|
||||
return Variant{std::in_place_index<current_index>, object.as<T>()};
|
||||
}
|
||||
else {
|
||||
if (index == current_index) {
|
||||
return object.as<T>();
|
||||
return Variant{std::in_place_index<current_index>, object.as<T>()};
|
||||
}
|
||||
return construct_variant<Variant, Ts...>(
|
||||
index,
|
||||
|
@@ -53,16 +53,16 @@ template <typename T>
|
||||
struct has_as {
|
||||
private:
|
||||
template <typename U>
|
||||
static auto check(U*) ->
|
||||
static auto check_(U*) ->
|
||||
// Check v1 specialization
|
||||
typename std::is_same<
|
||||
decltype(adaptor::as<U>()(std::declval<msgpack::object>())),
|
||||
T
|
||||
>::type;
|
||||
template <typename...>
|
||||
static std::false_type check(...);
|
||||
static std::false_type check_(...);
|
||||
public:
|
||||
using type = decltype(check<T>(MSGPACK_NULLPTR));
|
||||
using type = decltype(check_<T>(MSGPACK_NULLPTR));
|
||||
static constexpr bool value = type::value;
|
||||
};
|
||||
|
||||
|
@@ -79,7 +79,7 @@ template <typename T>
|
||||
struct has_as {
|
||||
private:
|
||||
template <typename U>
|
||||
static auto check(U*) ->
|
||||
static auto check_(U*) ->
|
||||
typename std::enable_if<
|
||||
// check v2 specialization
|
||||
std::is_same<
|
||||
@@ -92,9 +92,9 @@ private:
|
||||
std::true_type
|
||||
>::type;
|
||||
template <typename...>
|
||||
static std::false_type check(...);
|
||||
static std::false_type check_(...);
|
||||
public:
|
||||
using type = decltype(check<T>(MSGPACK_NULLPTR));
|
||||
using type = decltype(check_<T>(MSGPACK_NULLPTR));
|
||||
static constexpr bool value = type::value;
|
||||
};
|
||||
|
||||
|
@@ -36,7 +36,7 @@ template <typename T>
|
||||
struct has_as {
|
||||
private:
|
||||
template <typename U>
|
||||
static auto check(U*) ->
|
||||
static auto check_(U*) ->
|
||||
typename std::enable_if<
|
||||
// check v3 specialization
|
||||
std::is_same<
|
||||
@@ -52,9 +52,9 @@ private:
|
||||
std::true_type
|
||||
>::type;
|
||||
template <typename...>
|
||||
static std::false_type check(...);
|
||||
static std::false_type check_(...);
|
||||
public:
|
||||
using type = decltype(check<T>(MSGPACK_NULLPTR));
|
||||
using type = decltype(check_<T>(MSGPACK_NULLPTR));
|
||||
static constexpr bool value = type::value;
|
||||
};
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#define MSGPACK_VERSION_MAJOR 6
|
||||
#define MSGPACK_VERSION_MINOR 1
|
||||
#define MSGPACK_VERSION_REVISION 0
|
||||
#define MSGPACK_VERSION_REVISION 1
|
||||
|
@@ -1,6 +1,6 @@
|
||||
FIND_PACKAGE (Threads REQUIRED)
|
||||
FIND_PACKAGE (ZLIB)
|
||||
FIND_PACKAGE (Boost REQUIRED COMPONENTS unit_test_framework system)
|
||||
FIND_PACKAGE (Boost REQUIRED COMPONENTS unit_test_framework)
|
||||
|
||||
LIST (APPEND check_PROGRAMS
|
||||
array_ref.cpp
|
||||
@@ -79,7 +79,6 @@ FOREACH (source_file ${check_PROGRAMS})
|
||||
|
||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
||||
msgpack-cxx
|
||||
Boost::system
|
||||
Boost::unit_test_framework
|
||||
Threads::Threads
|
||||
ZLIB::ZLIB
|
||||
|
@@ -474,6 +474,28 @@ BOOST_AUTO_TEST_CASE(variant_pack_unpack_as) {
|
||||
oh.get().as<std::variant<bool, int, float, double> >();
|
||||
BOOST_CHECK(val1 == val2);
|
||||
BOOST_CHECK_THROW((oh.get().as<std::variant<bool>>()), msgpack::type_error);
|
||||
|
||||
{
|
||||
std::stringstream same_ss;
|
||||
std::variant<int, float, int> same_expected{std::in_place_index<2>, 2};
|
||||
msgpack::pack(same_ss, same_expected);
|
||||
std::string const& same_str = same_ss.str();
|
||||
msgpack::object_handle same_oh =
|
||||
msgpack::unpack(same_str.data(), same_str.size());
|
||||
std::variant<int, float, int> same_actual = same_oh->as<std::variant<int, float, int>>();
|
||||
BOOST_CHECK(same_expected == same_actual);
|
||||
}
|
||||
|
||||
{
|
||||
std::stringstream same_ss;
|
||||
std::variant<int, int> same_expected{std::in_place_index<1>, 2};
|
||||
msgpack::pack(same_ss, same_expected);
|
||||
std::string const& same_str = same_ss.str();
|
||||
msgpack::object_handle same_oh =
|
||||
msgpack::unpack(same_str.data(), same_str.size());
|
||||
std::variant<int, int> same_actual = same_oh->as<std::variant<int, int>>();
|
||||
BOOST_CHECK(same_expected == same_actual);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(variant_with_zone) {
|
||||
|
Reference in New Issue
Block a user