Skip to content

Commit

Permalink
Merge branch 'cpp_master' into fix/unpuck_segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
Arenoros authored May 26, 2024
2 parents 9d56e54 + 5c521bc commit 6d5214c
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/depends/zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ while getopts "b:t:p:" c; do
done

mkdir $prefix || exit 1
wget https://zlib.net/current/zlib.tar.gz || exit 1
mkdir zlib
tar -xf zlib.tar.gz -C zlib || exit 1
cd $(dirname $(find zlib -name zlib.h))

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()
{
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion QUICKSTART-CPP.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Same as QuickStart for C Language.

## First program

Include `msgpack.hpp` header and link `msgpack` library to use MessagePack on your program.
Include `msgpack.hpp` header to use MessagePack on your program.

```cpp
#include <msgpack.hpp>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
`msgpack` for C++
===================

Version 6.1.0 [![Build Status](https://github.com/msgpack/msgpack-c/workflows/CI/badge.svg?branch=cpp_master)](https://github.com/msgpack/msgpack-c/actions) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/cpp_master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/cpp_master)
Version 6.1.1 [![Build Status](https://github.com/msgpack/msgpack-c/workflows/CI/badge.svg?branch=cpp_master)](https://github.com/msgpack/msgpack-c/actions) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/cpp_master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/cpp_master)
[![codecov](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master/graph/badge.svg)](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master)

It's like JSON but smaller and faster.
Expand Down
10 changes: 6 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 6.1.0.{build}
version: 6.1.1.{build}

branches:
only:
Expand All @@ -23,9 +23,11 @@ environment:
boost_subdir: lib32-msvc-14.0
build_script:
- ps: |
appveyor DownloadFile https://zlib.net/current/zlib.tar.gz -FileName zlib.tar.gz
7z x zlib.tar.gz 2> $null
7z x zlib.tar 2> $null
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
Expand Down
4 changes: 2 additions & 2 deletions include/msgpack/v1/adaptor/cpp17/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion include/msgpack/version_master.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define MSGPACK_VERSION_MAJOR 6
#define MSGPACK_VERSION_MINOR 1
#define MSGPACK_VERSION_REVISION 0
#define MSGPACK_VERSION_REVISION 1
22 changes: 22 additions & 0 deletions test/msgpack_cpp17.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6d5214c

Please sign in to comment.