Compare commits

...

18 Commits

Author SHA1 Message Date
Takatoshi Kondo
53bfbba863 Merge pull request #988 from redboltz/cpp_4.0.3
Updated the version to 4.0.3.
2021-10-23 13:53:46 +09:00
Takatoshi Kondo
63221f5524 Updated the version to 4.0.3. 2021-10-23 13:28:06 +09:00
Takatoshi Kondo
fb01067a05 Merge pull request #987 from redboltz/refine_enabler
Removed Enabler2.
2021-10-23 13:01:03 +09:00
Takatoshi Kondo
af9ce1b627 Fixed test warning. 2021-10-23 12:17:34 +09:00
Takatoshi Kondo
9416c7cc5c Removed Enabler2. 2021-10-23 12:03:16 +09:00
Takatoshi Kondo
241f001d17 Merge branch 'marascio-add-build-docs-option' into cpp_master 2021-09-23 11:07:08 +09:00
Takatoshi Kondo
e148b2b26d Minimized boost install. 2021-09-23 10:45:53 +09:00
Louis R. Marascio
b4dcae20cc Add option MSGPACK_BUILD_DOCS.
This option explicitly controls the generation of targets related to
Doxygen generation, rather than relying solely on whether Doxygen is
discovered.

It is enabled by default to preserve existing behavior, but if disabled
then no Doxygen targets will be generated. This is useful when the
library is included via CMake's `add_subdirectory()`.
2021-09-22 11:40:40 -05:00
Takatoshi Kondo
3bdbf0d2ee Merge pull request #973 from redboltz/update_to_402
Updated the version to 4.0.2.
2021-08-31 10:06:48 +09:00
Takatoshi Kondo
d8324b58e9 Updated the version to 4.0.2. 2021-08-31 09:33:01 +09:00
Takatoshi Kondo
c0708dbcba Merge pull request #972 from kovdan01/fix_fuzz_running
Fix #969
2021-08-31 09:24:20 +09:00
Takatoshi Kondo
5dc0a904de Merge pull request #971 from kovdan01/add_boost_test_dyn_link
Add `MSGPACK_USE_STATIC_BOOST` cmake option (fix #970)
2021-08-31 09:07:53 +09:00
Daniil Kovalev
4ed6b45abd Add MSGPACK_USE_STATIC_BOOST cmake option 2021-08-30 23:01:49 +03:00
Daniil Kovalev
4ea4d69123 Fix #969 2021-08-30 21:45:50 +03:00
Takatoshi Kondo
0b8d6a6614 Merge pull request #968 from redboltz/updated_changelog
Updated to 4.0.1.
2021-08-30 10:39:02 +09:00
Takatoshi Kondo
1339343077 Updated to 4.0.1. 2021-08-30 09:27:08 +09:00
Takatoshi Kondo
4ca74c28fb Merge pull request #967 from redboltz/update_to_401
Updated the version to 4.0.1
2021-08-30 09:24:41 +09:00
Takatoshi Kondo
5ef0108088 Updated the version to 4.0.1
Fixed missing file and directory in makedist.sh.
2021-08-30 08:51:50 +09:00
17 changed files with 119 additions and 78 deletions

View File

@@ -210,7 +210,7 @@ jobs:
run: |
vcpkg update
vcpkg install zlib:x64-windows
vcpkg install boost:x64-windows
vcpkg install boost-assert:x64-windows boost-numeric-conversion:x64-windows boost-variant:x64-windows boost-utility:x64-windows boost-fusion:x64-windows boost-optional:x64-windows boost-predef:x64-windows boost-preprocessor:x64-windows boost-timer:x64-windows boost-test:x64-windows
- name: Build and test
shell: powershell

View File

@@ -1,3 +1,14 @@
# 2021-10-23 version 4.0.3 for C++
* Remove Enabler2 template parameter from object adaptor (#987)
* Add MSGPACK_BUILD_DOCS cmake option (#983, #984)
# 2021-08-31 version 4.0.2 for C++
* Fix fuzzer interface function name (#972)
* Fix boost test link error and support both dynamin(default) and static link boost (#971)
# 2021-08-30 version 4.0.1 for C++
* Fix release tarball and its generation script (#967)
# 2021-08-29 version 4.0.0 for C++
* Improve zone alignment logic (#965)
* Fix v1 unpack logic for STR and BIN (#957, #951)

View File

@@ -24,9 +24,12 @@ OPTION (MSGPACK_CXX20 "Using c++20 compiler" OFF)
OPTION (MSGPACK_32BIT "32bit compile" OFF)
OPTION (MSGPACK_USE_X3_PARSE "Use Boost X3 parse" OFF)
OPTION (MSGPACK_BUILD_TESTS "Build tests" OFF)
OPTION (MSGPACK_BUILD_DOCS "Build Doxygen documentation" ON)
OPTION (MSGPACK_FUZZ_REGRESSION "Enable regression testing" OFF)
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples" OFF)
OPTION (MSGPACK_GEN_COVERAGE "Generate coverage report" OFF)
OPTION (MSGPACK_USE_STATIC_BOOST "Statically link with boost libraries" OFF)
OPTION (MSGPACK_CHAR_SIGN "Char sign to use (signed or unsigned)")
SET (CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -60,7 +63,14 @@ IF (MSGPACK_32BIT)
ENDIF ()
SET (Boost_USE_MULTITHREADED ON)
SET (Boost_USE_STATIC_RUNTIME OFF)
IF (MSGPACK_USE_STATIC_BOOST)
MESSAGE (STATUS "Staticly linking with Boost")
SET (Boost_USE_STATIC_LIBS TRUE)
ELSE ()
MESSAGE (STATUS "Dynamically linking with Boost")
SET (Boost_USE_STATIC_LIBS FALSE)
ENDIF ()
IF (MSGPACK_CHAR_SIGN)
SET (CMAKE_CXX_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_CXX_FLAGS}")
@@ -69,6 +79,7 @@ ENDIF ()
IF (MSGPACK_DEFAULT_API_VERSION)
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=${MSGPACK_DEFAULT_API_VERSION} ${CMAKE_CXX_FLAGS}")
ELSE ()
SET (MSGPACK_DEFAULT_API_VERSION 3)
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=3 ${CMAKE_CXX_FLAGS}")
ENDIF ()
@@ -143,8 +154,9 @@ IF (MSGPACK_BUILD_EXAMPLES)
ENDIF ()
# Doxygen
FIND_PACKAGE (Doxygen)
IF (DOXYGEN_FOUND)
IF (MSGPACK_BUILD_DOCS)
FIND_PACKAGE (Doxygen)
IF (DOXYGEN_FOUND)
LIST (APPEND Doxyfile_cpp_CONTENT
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
COMMAND ${CMAKE_COMMAND} -E echo "FILE_PATTERNS = *.hpp" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
@@ -165,6 +177,7 @@ IF (DOXYGEN_FOUND)
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
VERBATIM
)
ENDIF ()
ENDIF ()
# Install library.

View File

@@ -1,7 +1,7 @@
`msgpack` for C++
===================
Version 4.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)
Version 4.0.3 [![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.
@@ -153,6 +153,8 @@ Other useful options:
- `MSGPACK_32BIT` (default `OFF`): 32bit compile
- `MSGPACK_USE_X3_PARSE` (default `OFF`): use Boost X3 parse
(note that it requires C++14 or newer)
- `MSGPACK_CHAR_SIGN` (not set explicitly by default): char sign to use (signed or unsigned)
- `MSGPACK_USE_STATIC_BOOST` (default `OFF`): statically link with boost libraries
#### GUI on Windows

View File

@@ -1,4 +1,4 @@
version: 4.0.0.{build}
version: 4.0.3.{build}
branches:
only:

View File

@@ -1,5 +1,5 @@
IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
FIND_PACKAGE (Boost REQUIRED COMPONENTS context system unit_test_framework)
FIND_PACKAGE (Boost REQUIRED COMPONENTS context system)
FIND_PACKAGE (Threads REQUIRED)
LIST (APPEND exec_PROGRAMS
@@ -43,7 +43,6 @@ IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
msgpackc-cxx
Boost::context
Boost::system
Boost::unit_test_framework
Threads::Threads
)
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")

View File

@@ -11,6 +11,10 @@ FOREACH (source_file ${check_PROGRAMS})
${source_file_we}
${source_file}
)
TARGET_COMPILE_DEFINITIONS (${source_file_we} PRIVATE
$<IF:$<BOOL:${MSGPACK_USE_STATIC_BOOST}>,,BOOST_TEST_DYN_LINK>)
TARGET_LINK_LIBRARIES (${source_file_we}
msgpackc-cxx
Threads::Threads
@@ -18,7 +22,9 @@ FOREACH (source_file ${check_PROGRAMS})
Boost::system
Boost::unit_test_framework
)
ADD_TEST (${source_file_we} ${source_file_we})
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Wno-mismatched-tags -g")
IF ("${MSGPACK_SAN}" STREQUAL "ASAN")

View File

@@ -38,7 +38,7 @@ void UnpackPackFuzzerRegressionTest(const std::string& fpath) {
std::vector<char> bytes(length);
in.read(bytes.data(), bytes.size());
BOOST_REQUIRE(in);
BOOST_REQUIRE_EQUAL(0, FuzzerTestOneInput(reinterpret_cast<const uint8_t *>(bytes.data()), bytes.size()));
BOOST_REQUIRE_EQUAL(0, LLVMFuzzerTestOneInput(reinterpret_cast<const uint8_t *>(bytes.data()), bytes.size()));
}
boost::unit_test::test_suite* init_unit_test_suite(int /*argc*/, char* /*argv*/[])

View File

@@ -1,6 +1,10 @@
#include <msgpack.hpp>
extern "C" int FuzzerTestOneInput(const uint8_t *data, size_t size) {
// The function's signature must NOT be changed since other projects rely on it:
// - libFuzzer
// - AFL++
// - Google's oss-fuzz (uses the previous two ones)
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
try {
// NOTE(derwolfe): by default the limits are set at 2^32-1 length. I'm
// setting these at far smaller values to avoid OOMs

View File

@@ -32,14 +32,15 @@ struct pack : v2::adaptor::pack<T, Enabler> {
};
template <typename T, typename Enabler>
struct object<
struct object
: v2::adaptor::object<
T,
Enabler,
typename msgpack::enable_if<
!msgpack::is_same<T, std::string>::value &&
!msgpack::is_array<T>::value
>::type>
: v2::adaptor::object<T, Enabler> {
!msgpack::is_array<T>::value,
Enabler
>::type
> {
};
template <typename T, typename Enabler>

View File

@@ -30,7 +30,7 @@ struct convert;
template <typename T, typename Enabler = void>
struct pack;
template <typename T, typename Enabler = void, typename Enabler2 = void>
template <typename T, typename Enabler = void>
struct object;
template <typename T, typename Enabler = void>

View File

@@ -1,3 +1,3 @@
#define MSGPACK_VERSION_MAJOR 4
#define MSGPACK_VERSION_MINOR 0
#define MSGPACK_VERSION_REVISION 0
#define MSGPACK_VERSION_REVISION 3

View File

@@ -19,6 +19,7 @@ tar --append --file=$filename $prefix/test
tar --append --file=$filename $prefix/include
tar --append --file=$filename $prefix/erb
tar --append --file=$filename $prefix/fuzz
tar --append --file=$filename $prefix/cmake
tar --append --file=$filename $prefix/CMakeLists.txt
tar --append --file=$filename $prefix/Files.cmake
@@ -31,7 +32,7 @@ tar --append --file=$filename $prefix/ChangeLog
tar --append --file=$filename $prefix/NEWS
tar --append --file=$filename $prefix/COPYING
tar --append --file=$filename $prefix/README
tar --append --file=$filename $prefix/msgpack-config.cmake.in
rm -f $prefix
gzip -f $filename

View File

@@ -74,6 +74,9 @@ FOREACH (source_file ${check_PROGRAMS})
${source_file}
)
TARGET_COMPILE_DEFINITIONS (${source_file_we} PRIVATE
$<IF:$<BOOL:${MSGPACK_USE_STATIC_BOOST}>,,BOOST_TEST_DYN_LINK>)
TARGET_LINK_LIBRARIES (${source_file_we}
msgpackc-cxx
Boost::system
@@ -81,6 +84,7 @@ FOREACH (source_file ${check_PROGRAMS})
Threads::Threads
ZLIB::ZLIB
)
ADD_TEST (NAME ${source_file_we} COMMAND ${source_file_we})
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")

View File

@@ -5,5 +5,5 @@
BOOST_AUTO_TEST_CASE(works)
{
BOOST_CHECK_EQUAL(0, FuzzerTestOneInput(MSGPACK_NULLPTR, 0));
BOOST_CHECK_EQUAL(0, LLVMFuzzerTestOneInput(MSGPACK_NULLPTR, 0));
}

View File

@@ -214,7 +214,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(simple_buffer, TypeParam, IntegerToFloatingPointTe
if (numeric_limits<integer_type>::is_signed) v.push_back(static_cast<integer_type>(-1));
else v.push_back(2);
for (unsigned int i = 0; i < kLoop; i++) {
v.push_back(rand() % 0x7FFFFF);
v.push_back(static_cast<integer_type>(rand() % 0x7FFFFF));
}
for (unsigned int i = 0; i < v.size() ; i++) {
msgpack::sbuffer sbuf;