Compare commits

..

25 Commits

Author SHA1 Message Date
Takatoshi Kondo
a0b2ec09da Merge pull request #1165 from MusicScience37/fix-error-for-empty-data-in-fbuffer
Fixed processing of empty data in fbuffer class.
2025-07-21 23:16:51 +09:00
Kenta Kabashima
6bd9a571f2 Fixed processing of empty data in fbuffer class. 2025-07-21 22:48:28 +09:00
Takatoshi Kondo
9b801f087a Merge pull request #1162 from jwbee/patch-1
Include type_traits before use of std:: members
2025-07-04 12:07:45 +09:00
Takatoshi Kondo
6d478cff4d Merge pull request #1163 from redboltz/update_windows_image_2022
Updated CI windows image to 2022
2025-07-04 12:06:36 +09:00
Takatoshi Kondo
3b0fc097f0 Updated CI windows image to 2022 2025-07-04 11:43:41 +09:00
Takatoshi Kondo
39aec8fe75 Merge pull request #1159 from redboltz/update_cmake_minimum_35
Updated cmake minimum required to 3.5-4.0
2025-07-04 11:19:32 +09:00
jwbee
cbeb5805cc Include type_traits before use of std:: members
msgpack-cpp relies on its users to include, directly or indirectly, the <type_traits> header before including msgpack headers. If they don't, it can't compile, because std::remove_volatile will not be declared. This fixes the issue by including it from msgpack, which should be fine now that msgpack-cpp requires C++11.
2025-07-03 11:26:35 -07:00
Takatoshi Kondo
2644706289 Updated cmake minimum required to 3.5-4.0 2025-05-18 21:09:47 +09:00
Takatoshi Kondo
1cde61e205 Merge pull request #1157 from redboltz/miyanyan-timespec
Miyanyan timespec
2025-05-17 11:08:02 +09:00
Takatoshi Kondo
8023a857e1 Updated CI ubuntu version. 2025-05-17 10:42:04 +09:00
miyanyan
0225acf247 timespec.hpp: remove duplicated include 2025-05-16 21:48:31 +08:00
Takatoshi Kondo
1876badbae Merge pull request #1154 from scrossuk/cpp_master
Work around MSVC C++20 modules error for nested msgpack::object::with_zone
2025-04-13 17:13:59 +09:00
Stephen Cross
712ec2e383 Work around MSVC C++20 modules error for nested msgpack::object::with_zone
When packaging msgpack into a C++20 module (by #include of msgpack in the
global module fragment and then `export using ...;` for relevant names),
MSVC (VS 17.13.5) reports the following:

```
error C2504: 'msgpack::v2::object': base class undefined
```

This is apparently due to with_zone being a nested type of msgpack::object;
in order to work around this problem, with_zone is replaced with an alias
to a struct defined outside of msgpack::object.
2025-04-10 12:56:17 +01:00
Takatoshi Kondo
800c483b99 Merge pull request #1151 from redboltz/fix_codecov_ignore_dir
Fixed codecov ignore directory typo.
2025-02-21 21:55:57 +09:00
Takatoshi Kondo
e18398a119 Fixed codecov ignore directory typo. 2025-02-21 21:29:43 +09:00
Takatoshi Kondo
f45dce33c2 Merge pull request #1150 from redboltz/update_codecov_action
Updated codecov-action to v5.
2025-02-21 21:27:38 +09:00
Takatoshi Kondo
3ccc51f44a Updated codecov badge link. 2025-02-21 20:55:42 +09:00
Takatoshi Kondo
86ce9185e2 Updated codecov-action to v5. 2025-02-21 20:36:42 +09:00
Takatoshi Kondo
aa719e81ea Merge pull request #1149 from redboltz/fix_ci2
Fixed boost download URL.
2025-02-21 19:28:33 +09:00
Takatoshi Kondo
765de1fd6d Fixed coverage upload. 2025-02-21 19:06:05 +09:00
Takatoshi Kondo
876a09b8ce Added ignore mismatch. 2025-02-21 18:25:55 +09:00
Takatoshi Kondo
1e294d7a12 Fixed boost download URL. 2025-02-21 17:58:30 +09:00
Takatoshi Kondo
766c8127df Merge pull request #1142 from uyha/cpp_master
Fixed `find_package` command in README
2025-02-21 17:04:36 +09:00
Takatoshi Kondo
f9f2917cc0 Merge pull request #1146 from redboltz/fix_brace
Fixed brace
2024-11-02 11:42:20 +09:00
Uy Ha
f2be864e04 Fixed find_package command in README 2024-10-08 15:11:59 +00:00
13 changed files with 37 additions and 38 deletions

View File

@@ -49,7 +49,7 @@ while getopts "b:t:p:" c; do
done
mkdir $prefix || exit 1
wget https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.tar.bz2 || exit 1
wget https://archives.boost.io/release/1.85.0/source/boost_1_85_0.tar.bz2 || exit 1
tar xf boost_1_85_0.tar.bz2 || exit 1
cd boost_1_85_0
./bootstrap.sh || exit 1

View File

@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Install build dependencies
run: |
sudo apt-get update
@@ -24,7 +24,7 @@ jobs:
- name: Cache boost
id: cache-boost
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/boost-prefix/
key: ${{ runner.os }}-boost-1-85-0-2024-05-27
@@ -35,7 +35,7 @@ jobs:
- name: Cache zlib
id: cache-zlib
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/zlib-prefix/
key: ${{ runner.os }}-zlib-64-1-2-11-2021-08-09
@@ -63,12 +63,15 @@ jobs:
cmake --build build --target all || exit 1
ctest --test-dir build || exit 1
- name: Upload coverage to Codecov
- name: Generate coverage
working-directory: build
run: |
# Create lcov report
lcov --capture --directory . --output-file coverage.info
lcov --capture --directory . --output-file coverage.info --ignore-errors mismatch
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
lcov --list coverage.info # debug info
# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: build/coverage.info
token: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -84,7 +84,7 @@ jobs:
linux:
name: ${{ format('Linux (pattern {0})', matrix.pattern) }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
@@ -136,7 +136,7 @@ jobs:
case ${{ matrix.pattern }} in
0)
export CXX="clang++-10"
export CXX="clang++"
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
;;
1)
@@ -144,7 +144,7 @@ jobs:
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
;;
2)
export CXX="clang++-10"
export CXX="clang++"
export MSGPACK_CXX_VERSION="MSGPACK_CXX14=ON"
;;
3)
@@ -153,7 +153,7 @@ jobs:
export MSGPACK_USE_STD_VARIANT_ADAPTOR="MSGPACK_USE_STD_VARIANT_ADAPTOR=ON"
;;
4)
export CXX="clang++-10"
export CXX="clang++"
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
export NO_BOOST="-DMSGPACK_NO_BOOST"
;;
@@ -162,7 +162,7 @@ jobs:
export ARCH=32
;;
6)
export CXX="clang++-10"
export CXX="clang++"
export API_VERSION=2
;;
7)
@@ -170,7 +170,7 @@ jobs:
export API_VERSION=1
;;
8)
export CXX="clang++-10"
export CXX="clang++"
export CHAR_SIGN="unsigned"
;;
9)
@@ -178,7 +178,7 @@ jobs:
export X3_PARSE="ON"
;;
10)
export CXX="clang++-10"
export CXX="clang++"
export ACTION="ci/build_regression.sh"
;;
11)
@@ -195,11 +195,11 @@ jobs:
windows:
name: ${{ format('Windows cxx{0}', matrix.cxx) }}
runs-on: windows-2019
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
# MSVC2019 only supports /std:c++14, /std:c++17 and /std:c++latest
# MSVC2022 only supports /std:c++14, /std:c++17 and /std:c++latest
cxx: [14, 17, 20]
pp_flag: ["/Zc:preprocessor-", "/Zc:preprocessor"]
steps:
@@ -228,7 +228,7 @@ jobs:
md build
cmake `
-A x64 `
-G "Visual Studio 16 2019" `
-G "Visual Studio 17 2022" `
-D CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" `
-D MSGPACK_BUILD_TESTS=ON `
-D $CPPVER `

View File

@@ -1,12 +1,4 @@
if(${CMAKE_VERSION} VERSION_GREATER "3.4")
CMAKE_MINIMUM_REQUIRED (VERSION 3.5)
else()
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12)
IF ((CMAKE_VERSION VERSION_GREATER 3.1) OR
(CMAKE_VERSION VERSION_EQUAL 3.1))
CMAKE_POLICY(SET CMP0054 NEW)
ENDIF ()
endif()
CMAKE_MINIMUM_REQUIRED (VERSION 3.5...4.0)
PROJECT (msgpack-cxx LANGUAGES CXX)
@@ -164,10 +156,10 @@ IF (MSGPACK_BUILD_TESTS)
MESSAGE(FATAL_ERROR "Test requires -DMSGPACK_USE_BOOST=ON")
ENDIF ()
ENABLE_TESTING ()
INCLUDE (CTest)
# MEMORYCHECK_COMMAND_OPTIONS needs to place prior to CTEST_MEMORYCHECK_COMMAND
SET (MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-leak-kinds=definite,possible --error-exitcode=1")
FIND_PROGRAM (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
INCLUDE (Dart)
ADD_SUBDIRECTORY (test)
ENDIF ()

View File

@@ -2,7 +2,7 @@
===================
Version 7.0.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)
[![codecov](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master/graph/badge.svg)](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master)
[![codecov](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master/graph/badge.svg)](https://app.codecov.io/gh/msgpack/msgpack-c/tree/cpp_master)
It's like JSON but smaller and faster.
@@ -87,7 +87,6 @@ For C++ compiler
clang++ -DMSGPACK_NO_BOOST your_code.cpp
```
Usage
-----
@@ -96,7 +95,7 @@ Usage
```cmake
# ...
find_package(msgpack REQUIRED)
find_package(msgpack-cxx REQUIRED)
# ...
target_link_libraries(your_target_name <PRIVATE/PUBLIC/INTERFACE> msgpack-cxx)
# ...

View File

@@ -48,7 +48,7 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
# Show info where to find the report
ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
COMMAND ;
COMMAND ${CMAKE_COMMAND} -E echo ""
COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report."
)

View File

@@ -31,6 +31,6 @@ ignore:
- "erb"
- "ci"
- "cmake"
- "examle"
- "example"
- "external"
- "usr"

View File

@@ -13,7 +13,6 @@
#include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/object.hpp"
#include "msgpack/object.hpp"
#include <ctime>

View File

@@ -87,6 +87,7 @@ struct is_pointer;
#include <memory>
#include <tuple>
#include <type_traits>
namespace msgpack {
/// @cond

View File

@@ -31,6 +31,7 @@ public:
{
MSGPACK_ASSERT(buf || len == 0);
if (!buf) return;
if (len == 0) return;
if (1 != fwrite(buf, len, 1, m_file)) {
throw std::runtime_error("fwrite() failed");
}

View File

@@ -32,11 +32,11 @@ struct object_kv {
msgpack::object val;
};
struct object::with_zone : msgpack::object {
with_zone(msgpack::zone& z) : zone(z) { }
struct object_with_zone_type : msgpack::object {
object_with_zone_type(msgpack::zone& z) : zone(z) { }
msgpack::zone& zone;
private:
with_zone();
object_with_zone_type();
};

View File

@@ -68,6 +68,8 @@ public:
#endif // !defined(MSGPACK_USE_CPP03)
struct object_with_zone_type;
/// Object class that corresponding to MessagePack format object
/**
* See https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_object
@@ -219,7 +221,8 @@ struct object {
template <typename T>
object& operator=(const T& v);
struct with_zone;
// Not a nested struct (i.e. 'struct with_zone;') to work around MSVC C++20 modules error C2504
typedef object_with_zone_type with_zone;
protected:
struct implicit_type;

View File

@@ -90,6 +90,7 @@ BOOST_AUTO_TEST_CASE(fbuffer)
fbuf.write("a", 1);
fbuf.write("a", 1);
fbuf.write("a", 1);
fbuf.write("", 0);
fflush(file);
rewind(file);