mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-23 08:31:45 +02:00
Compare commits
25 Commits
cpp-7.0.0
...
cpp_master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a0b2ec09da | ||
![]() |
6bd9a571f2 | ||
![]() |
9b801f087a | ||
![]() |
6d478cff4d | ||
![]() |
3b0fc097f0 | ||
![]() |
39aec8fe75 | ||
![]() |
cbeb5805cc | ||
![]() |
2644706289 | ||
![]() |
1cde61e205 | ||
![]() |
8023a857e1 | ||
![]() |
0225acf247 | ||
![]() |
1876badbae | ||
![]() |
712ec2e383 | ||
![]() |
800c483b99 | ||
![]() |
e18398a119 | ||
![]() |
f45dce33c2 | ||
![]() |
3ccc51f44a | ||
![]() |
86ce9185e2 | ||
![]() |
aa719e81ea | ||
![]() |
765de1fd6d | ||
![]() |
876a09b8ce | ||
![]() |
1e294d7a12 | ||
![]() |
766c8127df | ||
![]() |
f9f2917cc0 | ||
![]() |
f2be864e04 |
2
.github/depends/boost.sh
vendored
2
.github/depends/boost.sh
vendored
@@ -49,7 +49,7 @@ while getopts "b:t:p:" c; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
mkdir $prefix || exit 1
|
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
|
tar xf boost_1_85_0.tar.bz2 || exit 1
|
||||||
cd boost_1_85_0
|
cd boost_1_85_0
|
||||||
./bootstrap.sh || exit 1
|
./bootstrap.sh || exit 1
|
||||||
|
17
.github/workflows/coverage.yml
vendored
17
.github/workflows/coverage.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v3
|
||||||
- name: Install build dependencies
|
- name: Install build dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache boost
|
- name: Cache boost
|
||||||
id: cache-boost
|
id: cache-boost
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/boost-prefix/
|
path: ~/boost-prefix/
|
||||||
key: ${{ runner.os }}-boost-1-85-0-2024-05-27
|
key: ${{ runner.os }}-boost-1-85-0-2024-05-27
|
||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache zlib
|
- name: Cache zlib
|
||||||
id: cache-zlib
|
id: cache-zlib
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/zlib-prefix/
|
path: ~/zlib-prefix/
|
||||||
key: ${{ runner.os }}-zlib-64-1-2-11-2021-08-09
|
key: ${{ runner.os }}-zlib-64-1-2-11-2021-08-09
|
||||||
@@ -63,12 +63,15 @@ jobs:
|
|||||||
cmake --build build --target all || exit 1
|
cmake --build build --target all || exit 1
|
||||||
ctest --test-dir build || exit 1
|
ctest --test-dir build || exit 1
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Generate coverage
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
run: |
|
||||||
# Create lcov report
|
# 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 --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
|
||||||
lcov --list coverage.info # debug info
|
lcov --list coverage.info # debug info
|
||||||
# Uploading report to CodeCov
|
- name: Upload coverage to Codecov
|
||||||
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
|
uses: codecov/codecov-action@v5
|
||||||
|
with:
|
||||||
|
files: build/coverage.info
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
20
.github/workflows/gha.yml
vendored
20
.github/workflows/gha.yml
vendored
@@ -84,7 +84,7 @@ jobs:
|
|||||||
|
|
||||||
linux:
|
linux:
|
||||||
name: ${{ format('Linux (pattern {0})', matrix.pattern) }}
|
name: ${{ format('Linux (pattern {0})', matrix.pattern) }}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -136,7 +136,7 @@ jobs:
|
|||||||
|
|
||||||
case ${{ matrix.pattern }} in
|
case ${{ matrix.pattern }} in
|
||||||
0)
|
0)
|
||||||
export CXX="clang++-10"
|
export CXX="clang++"
|
||||||
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
@@ -144,7 +144,7 @@ jobs:
|
|||||||
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
export CXX="clang++-10"
|
export CXX="clang++"
|
||||||
export MSGPACK_CXX_VERSION="MSGPACK_CXX14=ON"
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX14=ON"
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
@@ -153,7 +153,7 @@ jobs:
|
|||||||
export MSGPACK_USE_STD_VARIANT_ADAPTOR="MSGPACK_USE_STD_VARIANT_ADAPTOR=ON"
|
export MSGPACK_USE_STD_VARIANT_ADAPTOR="MSGPACK_USE_STD_VARIANT_ADAPTOR=ON"
|
||||||
;;
|
;;
|
||||||
4)
|
4)
|
||||||
export CXX="clang++-10"
|
export CXX="clang++"
|
||||||
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
|
||||||
export NO_BOOST="-DMSGPACK_NO_BOOST"
|
export NO_BOOST="-DMSGPACK_NO_BOOST"
|
||||||
;;
|
;;
|
||||||
@@ -162,7 +162,7 @@ jobs:
|
|||||||
export ARCH=32
|
export ARCH=32
|
||||||
;;
|
;;
|
||||||
6)
|
6)
|
||||||
export CXX="clang++-10"
|
export CXX="clang++"
|
||||||
export API_VERSION=2
|
export API_VERSION=2
|
||||||
;;
|
;;
|
||||||
7)
|
7)
|
||||||
@@ -170,7 +170,7 @@ jobs:
|
|||||||
export API_VERSION=1
|
export API_VERSION=1
|
||||||
;;
|
;;
|
||||||
8)
|
8)
|
||||||
export CXX="clang++-10"
|
export CXX="clang++"
|
||||||
export CHAR_SIGN="unsigned"
|
export CHAR_SIGN="unsigned"
|
||||||
;;
|
;;
|
||||||
9)
|
9)
|
||||||
@@ -178,7 +178,7 @@ jobs:
|
|||||||
export X3_PARSE="ON"
|
export X3_PARSE="ON"
|
||||||
;;
|
;;
|
||||||
10)
|
10)
|
||||||
export CXX="clang++-10"
|
export CXX="clang++"
|
||||||
export ACTION="ci/build_regression.sh"
|
export ACTION="ci/build_regression.sh"
|
||||||
;;
|
;;
|
||||||
11)
|
11)
|
||||||
@@ -195,11 +195,11 @@ jobs:
|
|||||||
|
|
||||||
windows:
|
windows:
|
||||||
name: ${{ format('Windows cxx{0}', matrix.cxx) }}
|
name: ${{ format('Windows cxx{0}', matrix.cxx) }}
|
||||||
runs-on: windows-2019
|
runs-on: windows-2022
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
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]
|
cxx: [14, 17, 20]
|
||||||
pp_flag: ["/Zc:preprocessor-", "/Zc:preprocessor"]
|
pp_flag: ["/Zc:preprocessor-", "/Zc:preprocessor"]
|
||||||
steps:
|
steps:
|
||||||
@@ -228,7 +228,7 @@ jobs:
|
|||||||
md build
|
md build
|
||||||
cmake `
|
cmake `
|
||||||
-A x64 `
|
-A x64 `
|
||||||
-G "Visual Studio 16 2019" `
|
-G "Visual Studio 17 2022" `
|
||||||
-D CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" `
|
-D CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" `
|
||||||
-D MSGPACK_BUILD_TESTS=ON `
|
-D MSGPACK_BUILD_TESTS=ON `
|
||||||
-D $CPPVER `
|
-D $CPPVER `
|
||||||
|
@@ -1,12 +1,4 @@
|
|||||||
if(${CMAKE_VERSION} VERSION_GREATER "3.4")
|
CMAKE_MINIMUM_REQUIRED (VERSION 3.5...4.0)
|
||||||
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()
|
|
||||||
|
|
||||||
PROJECT (msgpack-cxx LANGUAGES CXX)
|
PROJECT (msgpack-cxx LANGUAGES CXX)
|
||||||
|
|
||||||
@@ -164,10 +156,10 @@ IF (MSGPACK_BUILD_TESTS)
|
|||||||
MESSAGE(FATAL_ERROR "Test requires -DMSGPACK_USE_BOOST=ON")
|
MESSAGE(FATAL_ERROR "Test requires -DMSGPACK_USE_BOOST=ON")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
ENABLE_TESTING ()
|
ENABLE_TESTING ()
|
||||||
|
INCLUDE (CTest)
|
||||||
# MEMORYCHECK_COMMAND_OPTIONS needs to place prior to CTEST_MEMORYCHECK_COMMAND
|
# 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")
|
SET (MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-leak-kinds=definite,possible --error-exitcode=1")
|
||||||
FIND_PROGRAM (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
|
FIND_PROGRAM (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
|
||||||
INCLUDE (Dart)
|
|
||||||
ADD_SUBDIRECTORY (test)
|
ADD_SUBDIRECTORY (test)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
===================
|
===================
|
||||||
|
|
||||||
Version 7.0.0 [](https://github.com/msgpack/msgpack-c/actions) [](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/cpp_master)
|
Version 7.0.0 [](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)
|
[](https://app.codecov.io/gh/msgpack/msgpack-c/tree/cpp_master)
|
||||||
|
|
||||||
It's like JSON but smaller and faster.
|
It's like JSON but smaller and faster.
|
||||||
|
|
||||||
@@ -87,7 +87,6 @@ For C++ compiler
|
|||||||
clang++ -DMSGPACK_NO_BOOST your_code.cpp
|
clang++ -DMSGPACK_NO_BOOST your_code.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|
||||||
@@ -96,7 +95,7 @@ Usage
|
|||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
# ...
|
# ...
|
||||||
find_package(msgpack REQUIRED)
|
find_package(msgpack-cxx REQUIRED)
|
||||||
# ...
|
# ...
|
||||||
target_link_libraries(your_target_name <PRIVATE/PUBLIC/INTERFACE> msgpack-cxx)
|
target_link_libraries(your_target_name <PRIVATE/PUBLIC/INTERFACE> msgpack-cxx)
|
||||||
# ...
|
# ...
|
||||||
|
@@ -48,7 +48,7 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
|
|||||||
|
|
||||||
# Show info where to find the report
|
# Show info where to find the report
|
||||||
ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
|
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."
|
COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -31,6 +31,6 @@ ignore:
|
|||||||
- "erb"
|
- "erb"
|
||||||
- "ci"
|
- "ci"
|
||||||
- "cmake"
|
- "cmake"
|
||||||
- "examle"
|
- "example"
|
||||||
- "external"
|
- "external"
|
||||||
- "usr"
|
- "usr"
|
||||||
|
@@ -13,7 +13,6 @@
|
|||||||
#include "msgpack/versioning.hpp"
|
#include "msgpack/versioning.hpp"
|
||||||
#include "msgpack/adaptor/adaptor_base.hpp"
|
#include "msgpack/adaptor/adaptor_base.hpp"
|
||||||
#include "msgpack/object.hpp"
|
#include "msgpack/object.hpp"
|
||||||
#include "msgpack/object.hpp"
|
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
|
@@ -87,6 +87,7 @@ struct is_pointer;
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
namespace msgpack {
|
namespace msgpack {
|
||||||
/// @cond
|
/// @cond
|
||||||
|
@@ -31,6 +31,7 @@ public:
|
|||||||
{
|
{
|
||||||
MSGPACK_ASSERT(buf || len == 0);
|
MSGPACK_ASSERT(buf || len == 0);
|
||||||
if (!buf) return;
|
if (!buf) return;
|
||||||
|
if (len == 0) return;
|
||||||
if (1 != fwrite(buf, len, 1, m_file)) {
|
if (1 != fwrite(buf, len, 1, m_file)) {
|
||||||
throw std::runtime_error("fwrite() failed");
|
throw std::runtime_error("fwrite() failed");
|
||||||
}
|
}
|
||||||
|
@@ -32,11 +32,11 @@ struct object_kv {
|
|||||||
msgpack::object val;
|
msgpack::object val;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct object::with_zone : msgpack::object {
|
struct object_with_zone_type : msgpack::object {
|
||||||
with_zone(msgpack::zone& z) : zone(z) { }
|
object_with_zone_type(msgpack::zone& z) : zone(z) { }
|
||||||
msgpack::zone& zone;
|
msgpack::zone& zone;
|
||||||
private:
|
private:
|
||||||
with_zone();
|
object_with_zone_type();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -68,6 +68,8 @@ public:
|
|||||||
|
|
||||||
#endif // !defined(MSGPACK_USE_CPP03)
|
#endif // !defined(MSGPACK_USE_CPP03)
|
||||||
|
|
||||||
|
struct object_with_zone_type;
|
||||||
|
|
||||||
/// Object class that corresponding to MessagePack format object
|
/// Object class that corresponding to MessagePack format object
|
||||||
/**
|
/**
|
||||||
* See https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_object
|
* See https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_object
|
||||||
@@ -219,7 +221,8 @@ struct object {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
object& operator=(const T& v);
|
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:
|
protected:
|
||||||
struct implicit_type;
|
struct implicit_type;
|
||||||
|
@@ -90,6 +90,7 @@ BOOST_AUTO_TEST_CASE(fbuffer)
|
|||||||
fbuf.write("a", 1);
|
fbuf.write("a", 1);
|
||||||
fbuf.write("a", 1);
|
fbuf.write("a", 1);
|
||||||
fbuf.write("a", 1);
|
fbuf.write("a", 1);
|
||||||
|
fbuf.write("", 0);
|
||||||
|
|
||||||
fflush(file);
|
fflush(file);
|
||||||
rewind(file);
|
rewind(file);
|
||||||
|
Reference in New Issue
Block a user