Compare commits

..

45 Commits

Author SHA1 Message Date
Takatoshi Kondo
1edfba0cd2 Update CHANGELOG. 2023-03-04 22:44:38 +09:00
Takatoshi Kondo
bc2c446e97 Merge pull request #1054 from redboltz/unify_project_name_cxx
Unify all package related names to msgpack-cxx.
2023-03-04 21:34:58 +09:00
Takatoshi Kondo
ec8895155c Unify all package related names to msgpack-cxx.
Update the version to 6.0.0.
2023-02-28 10:52:21 +09:00
Takatoshi Kondo
8824c626b4 Merge pull request #1048 from redboltz/fix_make_dist.sh_cxx
Fixed cmake config.
2023-01-10 21:36:31 +09:00
Takatoshi Kondo
960656648b Fixed cmake config. 2023-01-10 20:05:13 +09:00
Takatoshi Kondo
dcabd641b5 Merge pull request #1046 from redboltz/update_to_500_cxx
Update the version to 5.0.0.
2023-01-10 19:57:54 +09:00
Takatoshi Kondo
cfb543401a Update the version to 5.0.0. 2023-01-10 18:45:39 +09:00
Takatoshi Kondo
db4fcf9109 Merge pull request #1045 from traversaro/patch-2
Change CMake package name of C++ library to msgpackc-cxx
2023-01-10 18:32:38 +09:00
Silvio Traversaro
0726c3d930 Change CMake package name of C++ library to msgpackc-cxx 2023-01-05 15:40:38 +01:00
Silvio Traversaro
6c78b521b4 Change CMake package name of C++ library to msgpackc-cxx 2023-01-05 15:37:36 +01:00
Silvio Traversaro
f6d4704605 Change CMake package name of C++ library to msgpackc-cxx 2023-01-05 15:37:01 +01:00
Takatoshi Kondo
7c3ef8e7c5 Merge pull request #1040 from laitingsheng/cpp_master
Fix config for new MSVC preprocessor
2022-11-09 19:59:37 +09:00
Tinson Lai
8fac2a5ca9 Fix config for new MSVC preprocessor 2022-11-08 18:32:54 +08:00
Takatoshi Kondo
7e56a08074 Merge pull request #1039 from redboltz/update_to_413
Update the version to 4.1.3.
2022-11-02 13:46:28 +09:00
Takatoshi Kondo
d679ba57a0 Update the version to 4.1.3. 2022-11-02 12:55:54 +09:00
Takatoshi Kondo
2603c2a591 Merge pull request #1038 from redboltz/fix_1037
Fixed #1037.
2022-11-02 12:52:59 +09:00
Takatoshi Kondo
535bf33681 Updated zlib on CI. 2022-11-02 09:58:46 +09:00
Takatoshi Kondo
b051192ed6 Fixed #1037.
Added MSGPACK_NO_BOOST guard for direct inclusion of chrono adaptor,
2022-11-02 09:58:36 +09:00
Takatoshi Kondo
fb64ea0b68 Merge pull request #1033 from redboltz/upd_412
Update the version to 4.1.2.
2022-09-07 13:22:21 +09:00
Takatoshi Kondo
0b9a597360 Update the version to 4.1.2. 2022-09-07 12:55:10 +09:00
Takatoshi Kondo
d5cef62cb9 Merge pull request #1032 from AlexisTM/feature/prevent_usage_of_boost
Prevents the looking for boost if built without it for dependents
2022-09-02 16:10:02 +09:00
Alexis Paques
0b2c6d9d1a Prevent looking for Boost if we do not need it 2022-08-31 11:04:31 +00:00
Takatoshi Kondo
cef8a6fdfa Merge pull request #1028 from redboltz/fix_1025
Fixed #1025.
2022-08-19 22:11:27 +09:00
Takatoshi Kondo
cd5ba5057e Merge pull request #1030 from redboltz/fix_1029
Fixed #1029.
2022-08-19 22:10:46 +09:00
Takatoshi Kondo
5eabf7189a Fixed #1029.
Removed invalid `noexcept` from zone's constructor.
2022-08-19 09:34:07 +09:00
Takatoshi Kondo
12be5d06e3 Fixed #1025.
Propagate compiler options that are decided by cmake options to the
parent project.
2022-08-06 10:58:36 +09:00
Takatoshi Kondo
25c3947a91 Merge pull request #1011 from timblechmann/fix/make-some-headers-self-contained
make some headers self-contained
2022-07-10 19:55:31 +09:00
Takatoshi Kondo
d13d933eea Merge pull request #1018 from GeorgFritze/cpp_master
pack double and float more size efficient
2022-06-13 23:02:38 +09:00
GeorgFritze
33ff3a45b8 fix undefined bahaviour in msgpack_basic tests 2022-06-13 10:58:45 +02:00
GeorgFritze
05de839b44 fix bug in pack_float and pack_double 2022-06-13 09:18:22 +02:00
GeorgFritze
d59e1d7716 update msgpack_basic test for compact double packaging
update pack_double and pack_float to avoid warnings
2022-06-07 09:46:39 +02:00
GeorgFritze
d5c837b612 style changes 2022-06-03 15:08:23 +02:00
GeorgFritze
3b405fcab3 Merge branch 'msgpack:cpp_master' into cpp_master 2022-06-02 10:41:36 +02:00
GeorgFritze
68acf21a8e pack double and float in a more size efficient way
check also for nan and numeric limits
2022-06-02 10:40:51 +02:00
Takatoshi Kondo
05f654fd64 Merge pull request #1021 from drdzyk/cpp_master
fix detection of linux based os
2022-05-25 20:24:05 +09:00
Stanislav Eismont
07c5b00c4a update zlib from 1.2.11 to 1.2.12 version to prevent CI failure. 1.2.11 version is no longer available 2022-05-25 13:31:04 +03:00
Stanislav Eismont
7bcb6aad05 fix detection of linux based os. According to https://sourceforge.net/p/predef/wiki/OperatingSystems/ 'linux' macro is obsolete, '__linux__' should be used instead. It turns out that 'linux' macro undefined when compiling project with e.g. '-std=c++11' compilation flag 2022-05-25 10:42:43 +03:00
Georg Fritze
6f0683bb46 pack double and float more size efficient 2022-05-13 13:04:17 +02:00
Tim Blechmann
8b87e62835 make some headers self-contained
some headers are not self-contained, as they depend on
symbols from headers which aren't included
2022-03-23 15:29:12 +08:00
Takatoshi Kondo
63511f29db Merge pull request #1008 from redboltz/upd_411
Update version to 4.1.1.
2022-03-09 20:58:42 +09:00
Takatoshi Kondo
ff707d8fb5 Update version to 4.1.1. 2022-03-09 20:10:25 +09:00
Takatoshi Kondo
2c832ff91a Merge pull request #1007 from redboltz/temp_fix_1005
Remove chrono support on MSGPACK_NO_BOOST.
2022-03-09 14:20:10 +09:00
Takatoshi Kondo
e596b6fe35 Remove chrono support on MSGPACK_NO_BOOST. 2022-03-09 12:55:17 +09:00
Takatoshi Kondo
34e411436b Merge pull request #1003 from jamessan/config-installdir
Install version/config files under CMAKE_INSTALL_LIBDIR
2022-02-14 19:23:15 +09:00
James McCoy
b4d800e6e4 Install version/config files under CMAKE_INSTALL_LIBDIR
Prior to the c_master/cpp_master split, this is where the files were
installed (c.f., 6e7deb8091/CMakeLists.txt (L454))
but this was changed to use "lib/" directly when updating the C++-only
packaging.

Re-instate the use of CMAKE_INSTALL_LIBDIR so the user can control where
they are installed and they follow the typical convention for location.
2022-02-13 17:05:08 -05:00
80 changed files with 223 additions and 84 deletions

View File

@@ -27,9 +27,9 @@ while getopts "b:t:p:" c; do
done done
mkdir $prefix || exit 1 mkdir $prefix || exit 1
wget https://zlib.net/zlib-1.2.11.tar.gz || exit 1 wget https://zlib.net/zlib-1.2.13.tar.gz || exit 1
tar -xf zlib-1.2.11.tar.gz || exit 1 tar -xf zlib-1.2.13.tar.gz || exit 1
cd zlib-1.2.11 cd zlib-1.2.13
build() build()
{ {

View File

@@ -25,7 +25,7 @@ jobs:
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: ~/boost-prefix/ path: ~/boost-prefix/
key: ${{ runner.os }}-boost-1-76-0-2021-08-09 key: ${{ runner.os }}-boost-1-76-0-2022-08-09
- name: Build boost - name: Build boost
if: steps.cache-boost.outputs.cache-hit != 'true' if: steps.cache-boost.outputs.cache-hit != 'true'
@@ -36,7 +36,7 @@ jobs:
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: ~/zlib-prefix/ path: ~/zlib-prefix/
key: ${{ runner.os }}-zlib-1-2-11-2021-08-09 key: ${{ runner.os }}-zlib-1-2-13-2022-11-02
- name: Build zlib - name: Build zlib
if: steps.cache-zlib.outputs.cache-hit != 'true' if: steps.cache-zlib.outputs.cache-hit != 'true'
@@ -111,7 +111,7 @@ jobs:
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: ~/zlib-prefix/ path: ~/zlib-prefix/
key: ${{ runner.os }}-zlib-1-2-11-2021-08-09 key: ${{ runner.os }}-zlib-1-2-13-2022-11-02
- name: Build zlib - name: Build zlib
if: steps.cache-zlib.outputs.cache-hit != 'true' if: steps.cache-zlib.outputs.cache-hit != 'true'
@@ -195,6 +195,7 @@ jobs:
matrix: matrix:
# MSVC2019 only supports /std:c++14, /std:c++17 and /std:c++latest # MSVC2019 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"]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -225,7 +226,7 @@ jobs:
-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 `
-D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING /D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING /W3 /WX" ` -D CMAKE_CXX_FLAGS="${{ matrix.pp_flag }} /D_VARIADIC_MAX=10 /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING /D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING /W3 /WX" `
-B build ` -B build `
-S . -S .
if ($LastExitCode -ne 0) { exit $LastExitCode } if ($LastExitCode -ne 0) { exit $LastExitCode }

View File

@@ -1,3 +1,28 @@
# 2023-03-02 version 6.0.0
## << breaking changes >>
* Change CMake package name of C++ library to msgpack-cxx (#1054)
Unified all C++ package, library, cmake, tarball name become msgpack-cxx.
# 2023-01-10 version 5.0.0 for C++
* Fix config for new MSVC preprocessor (#1040)
## << breaking changes >>
* Change CMake package name of C++ library to msgpackc-cxx (#1045, #1048)
# 2022-11-02 version 4.1.3 for C++
* Fix compile error that direct inclusion of chrono with `MSGPACK_NO_BOOST` (#1038))
# 2022-09-07 version 4.1.2 for C++
* Fix noexcept on zone (#1030)
* Improve cmake support (#1028, #1032)
* Improve CI (#1023)
* Improve supporting platform (#1021)
* Refine double/float packing (#1018)
* Refine include files dependency (#1011)
# 2022-03-09 version 4.1.1 for C++
* Remove chrono support on `MSGPACK_NO_BOOST` to fix compile error.
* Improve build system (#1003)
# 2022-02-12 version 4.1.0 for C++ # 2022-02-12 version 4.1.0 for C++
* Add experimental support for no boost dependency (#1001) * Add experimental support for no boost dependency (#1001)
* For cmake, add `-DMSGPACK_USE_BOOST=OFF`. For C++ compiler add `-DMSGPACK_NO_BOOST`. * For cmake, add `-DMSGPACK_USE_BOOST=OFF`. For C++ compiler add `-DMSGPACK_NO_BOOST`.

View File

@@ -2,7 +2,9 @@ CMAKE_MINIMUM_REQUIRED (VERSION 3.1 FATAL_ERROR)
CMAKE_POLICY (SET CMP0054 NEW) CMAKE_POLICY (SET CMP0054 NEW)
PROJECT (msgpack LANGUAGES CXX) PROJECT (msgpack-cxx LANGUAGES CXX)
ADD_LIBRARY (msgpack-cxx INTERFACE)
FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/version_master.hpp contents) FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/version_master.hpp contents)
STRING (REGEX MATCH "#define MSGPACK_VERSION_MAJOR *([0-9a-zA-Z_]*)" NULL_OUT ${contents}) STRING (REGEX MATCH "#define MSGPACK_VERSION_MAJOR *([0-9a-zA-Z_]*)" NULL_OUT ${contents})
@@ -55,11 +57,11 @@ ENDIF ()
IF (MSGPACK_32BIT) IF (MSGPACK_32BIT)
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET (CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}") TARGET_COMPILE_OPTIONS(msgpack-cxx INTERFACE -m32)
SET (CMAKE_EXE_LINKER_FLAGS "-m32 ${CMAKE_EXE_LINKER_FLAGS}") TARGET_LINK_OPTIONS(msgpack-cxx INTERFACE -m32)
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") ELSEIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET (CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}") TARGET_COMPILE_OPTIONS(msgpack-cxx INTERFACE -m32)
SET (CMAKE_EXE_LINKER_FLAGS "-m32 ${CMAKE_EXE_LINKER_FLAGS}") TARGET_LINK_OPTIONS(msgpack-cxx INTERFACE -m32)
ENDIF () ENDIF ()
ENDIF () ENDIF ()
@@ -76,18 +78,18 @@ IF (MSGPACK_USE_BOOST)
FIND_PACKAGE (Boost REQUIRED) FIND_PACKAGE (Boost REQUIRED)
ELSE () ELSE ()
SET (CMAKE_CXX_FLAGS "-DMSGPACK_NO_BOOST ${CMAKE_CXX_FLAGS}") TARGET_COMPILE_DEFINITIONS(msgpack-cxx INTERFACE MSGPACK_NO_BOOST)
ENDIF () ENDIF ()
IF (MSGPACK_CHAR_SIGN) IF (MSGPACK_CHAR_SIGN)
SET (CMAKE_CXX_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_CXX_FLAGS}") TARGET_COMPILE_OPTIONS(msgpack-cxx INTERFACE -f${MSGPACK_CHAR_SIGN}-char)
ENDIF () ENDIF ()
IF (MSGPACK_DEFAULT_API_VERSION) IF (MSGPACK_DEFAULT_API_VERSION)
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=${MSGPACK_DEFAULT_API_VERSION} ${CMAKE_CXX_FLAGS}") TARGET_COMPILE_DEFINITIONS(msgpack-cxx INTERFACE MSGPACK_DEFAULT_API_VERSION=${MSGPACK_DEFAULT_API_VERSION})
ELSE () ELSE ()
SET (MSGPACK_DEFAULT_API_VERSION 3) SET (MSGPACK_DEFAULT_API_VERSION 3)
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=3 ${CMAKE_CXX_FLAGS}") TARGET_COMPILE_DEFINITIONS(msgpack-cxx INTERFACE MSGPACK_DEFAULT_API_VERSION=3)
ENDIF () ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@@ -110,9 +112,7 @@ ENDIF ()
INCLUDE (Files.cmake) INCLUDE (Files.cmake)
ADD_LIBRARY (msgpackc-cxx INTERFACE) TARGET_INCLUDE_DIRECTORIES (msgpack-cxx
TARGET_INCLUDE_DIRECTORIES (msgpackc-cxx
INTERFACE INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
@@ -120,7 +120,7 @@ TARGET_INCLUDE_DIRECTORIES (msgpackc-cxx
) )
IF (MSGPACK_USE_BOOST) IF (MSGPACK_USE_BOOST)
TARGET_LINK_LIBRARIES (msgpackc-cxx INTERFACE Boost::boost) TARGET_LINK_LIBRARIES (msgpack-cxx INTERFACE Boost::boost)
ENDIF () ENDIF ()
IF (MSGPACK_GEN_COVERAGE) IF (MSGPACK_GEN_COVERAGE)
@@ -134,7 +134,6 @@ IF (MSGPACK_GEN_COVERAGE)
INCLUDE (CodeCoverage) INCLUDE (CodeCoverage)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS}") SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS}")
SETUP_TARGET_FOR_COVERAGE(coverage make coverage test) SETUP_TARGET_FOR_COVERAGE(coverage make coverage test)
ENDIF () ENDIF ()
@@ -157,7 +156,7 @@ IF (MSGPACK_FUZZ_REGRESSION)
ENDIF () ENDIF ()
IF ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "sparc") IF ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "sparc")
SET (CMAKE_CXX_FLAGS "-DMSGPACK_ZONE_ALIGN=8 ${CMAKE_CXX_FLAGS}") TARGET_COMPILE_DEFINITIONS(msgpack-cxx INTERFACE MSGPACK_ZONE_ALIGN=8)
ENDIF () ENDIF ()
IF (MSGPACK_BUILD_EXAMPLES) IF (MSGPACK_BUILD_EXAMPLES)
@@ -191,10 +190,12 @@ IF (MSGPACK_BUILD_DOCS)
ENDIF () ENDIF ()
ENDIF () ENDIF ()
include (GNUInstallDirs)
# Install library. # Install library.
INSTALL (TARGETS msgpackc-cxx INSTALL (TARGETS msgpack-cxx
EXPORT msgpackc-cxx-targets EXPORT msgpack-cxx-targets
COMPONENT msgpackc-cxx COMPONENT msgpack-cxx
# This provides include directory in exported target # This provides include directory in exported target
# relative to prefix in single directory we've put everything in. # relative to prefix in single directory we've put everything in.
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
@@ -203,7 +204,7 @@ INSTALL (TARGETS msgpackc-cxx
# Install headers from source tree. # Install headers from source tree.
INSTALL (DIRECTORY include/ INSTALL (DIRECTORY include/
DESTINATION include DESTINATION include
COMPONENT msgpackc-cxx COMPONENT msgpack-cxx
) )
INCLUDE (CMakePackageConfigHelpers) INCLUDE (CMakePackageConfigHelpers)
@@ -211,18 +212,18 @@ INCLUDE (CMakePackageConfigHelpers)
IF (NOT (CMAKE_VERSION VERSION_LESS 3.14)) IF (NOT (CMAKE_VERSION VERSION_LESS 3.14))
SET (extra_version_file_args ARCH_INDEPENDENT) SET (extra_version_file_args ARCH_INDEPENDENT)
ENDIF () ENDIF ()
SET (cmake_config_path "lib/cmake/msgpackc-cxx") SET (cmake_config_path "${CMAKE_INSTALL_LIBDIR}/cmake/msgpack-cxx")
# Configure the main package file from source tree. # Configure the main package file from source tree.
CONFIGURE_PACKAGE_CONFIG_FILE ( CONFIGURE_PACKAGE_CONFIG_FILE (
msgpack-config.cmake.in msgpack-cxx-config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/msgpack-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/msgpack-cxx-config.cmake"
INSTALL_DESTINATION "${cmake_config_path}" INSTALL_DESTINATION "${cmake_config_path}"
) )
# Write package version file. # Write package version file.
WRITE_BASIC_PACKAGE_VERSION_FILE ( WRITE_BASIC_PACKAGE_VERSION_FILE (
msgpack-config-version.cmake msgpack-cxx-config-version.cmake
VERSION ${VERSION} VERSION ${VERSION}
COMPATIBILITY SameMajorVersion COMPATIBILITY SameMajorVersion
${extra_version_file_args} ${extra_version_file_args}
@@ -230,16 +231,16 @@ WRITE_BASIC_PACKAGE_VERSION_FILE (
# Install the generated package version file and the main package file. # Install the generated package version file and the main package file.
INSTALL (FILES INSTALL (FILES
"${CMAKE_CURRENT_BINARY_DIR}/msgpack-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/msgpack-cxx-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/msgpack-config-version.cmake" "${CMAKE_CURRENT_BINARY_DIR}/msgpack-cxx-config-version.cmake"
DESTINATION "${cmake_config_path}" DESTINATION "${cmake_config_path}"
COMPONENT msgpackc-cxx COMPONENT msgpack-cxx
) )
# This installs package in install tree for using installed targets. # This installs package in install tree for using installed targets.
INSTALL ( INSTALL (
EXPORT msgpackc-cxx-targets EXPORT msgpack-cxx-targets
FILE msgpackc-cxx-targets.cmake FILE msgpack-cxx-targets.cmake
DESTINATION "${cmake_config_path}" DESTINATION "${cmake_config_path}"
COMPONENT msgpackc-cxx COMPONENT msgpack-cxx
) )

View File

@@ -1,4 +1,4 @@
SET (msgpackc_HEADERS SET (msgpack-cxx_HEADERS
include/msgpack.hpp include/msgpack.hpp
include/msgpack/adaptor/adaptor_base.hpp include/msgpack/adaptor/adaptor_base.hpp
include/msgpack/adaptor/adaptor_base_decl.hpp include/msgpack/adaptor/adaptor_base_decl.hpp

View File

@@ -1,7 +1,7 @@
`msgpack` for C++ `msgpack` for C++
=================== ===================
Version 4.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.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://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master)
It's like JSON but smaller and faster. It's like JSON but smaller and faster.
@@ -98,7 +98,7 @@ Usage
# ... # ...
find_package(msgpack REQUIRED) find_package(msgpack REQUIRED)
# ... # ...
target_link_libraries(your_target_name <PRIVATE/PUBLIC/INTERFACE> msgpackc-cxx) target_link_libraries(your_target_name <PRIVATE/PUBLIC/INTERFACE> msgpack-cxx)
# ... # ...
``` ```

View File

@@ -1,4 +1,4 @@
version: 4.1.0.{build} version: 6.0.0.{build}
branches: branches:
only: only:
@@ -23,10 +23,10 @@ environment:
boost_subdir: lib32-msvc-14.0 boost_subdir: lib32-msvc-14.0
build_script: build_script:
- ps: | - ps: |
appveyor DownloadFile http://zlib.net/zlib-1.2.11.tar.gz -FileName zlib-1.2.11.tar.gz appveyor DownloadFile http://zlib.net/zlib-1.2.13.tar.gz -FileName zlib-1.2.13.tar.gz
7z x zlib-1.2.11.tar.gz 2> $null 7z x zlib-1.2.13.tar.gz 2> $null
7z x zlib-1.2.11.tar 2> $null 7z x zlib-1.2.13.tar 2> $null
cd zlib-1.2.11 cd zlib-1.2.13
md build md build
md prefix md prefix
@@ -34,7 +34,7 @@ build_script:
cmake ` cmake `
-G $env:msvc ` -G $env:msvc `
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.11\prefix" ` -D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.13\prefix" `
.. ..
if ($LastExitCode -ne 0) { exit $LastExitCode } if ($LastExitCode -ne 0) { exit $LastExitCode }
@@ -52,7 +52,7 @@ build_script:
-D MSGPACK_BUILD_EXAMPLES=ON ` -D MSGPACK_BUILD_EXAMPLES=ON `
-D MSGPACK_BUILD_TESTS=ON ` -D MSGPACK_BUILD_TESTS=ON `
-D CMAKE_EXE_LINKER_FLAGS=/LIBPATH:"$env:boost_prefix\$env:boost_subdir" ` -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.11\prefix" ` -D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.13\prefix" `
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" ` -D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" `
-D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" ` -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 } if ($LastExitCode -ne 0) { exit $LastExitCode }
test_script: test_script:
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir% - set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.2.13\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir%
- ctest -VV -C Release - ctest -VV -C Release

View File

@@ -138,7 +138,7 @@ class zone {
finalizer_array m_finalizer_array; finalizer_array m_finalizer_array;
public: public:
zone(size_t chunk_size = MSGPACK_ZONE_CHUNK_SIZE) /* throw() */; zone(size_t chunk_size = MSGPACK_ZONE_CHUNK_SIZE);
public: public:
void* allocate_align(size_t size, size_t align = MSGPACK_ZONE_ALIGN); void* allocate_align(size_t size, size_t align = MSGPACK_ZONE_ALIGN);
@@ -194,7 +194,7 @@ private:
zone& operator=(const zone&); zone& operator=(const zone&);
}; };
inline zone::zone(size_t chunk_size) /* throw() */ :m_chunk_size(chunk_size), m_chunk_list(m_chunk_size) inline zone::zone(size_t chunk_size):m_chunk_size(chunk_size), m_chunk_list(m_chunk_size)
{ {
} }

View File

@@ -21,7 +21,7 @@ FOREACH (source_file ${exec_PROGRAMS})
${source_file} ${source_file}
) )
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
msgpackc-cxx msgpack-cxx
Boost::system Boost::system
Threads::Threads Threads::Threads
) )

View File

@@ -43,7 +43,7 @@ FOREACH (source_file ${exec_PROGRAMS})
${source_file} ${source_file}
) )
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
msgpackc-cxx msgpack-cxx
) )
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra") SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
@@ -64,7 +64,7 @@ FOREACH (source_file ${with_pthread_PROGRAMS})
${source_file} ${source_file}
) )
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
msgpackc-cxx msgpack-cxx
Threads::Threads Threads::Threads
) )
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@@ -86,7 +86,7 @@ FOREACH (source_file ${with_boost_lib_PROGRAMS})
${source_file} ${source_file}
) )
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
msgpackc-cxx msgpack-cxx
Boost::timer Boost::timer
) )
IF (NOT MSVC AND NOT APPLE) IF (NOT MSVC AND NOT APPLE)

View File

@@ -17,7 +17,7 @@ IF (MSGPACK_CXX11 OR MSGPACK_CXX14 OR MSGPACK_CXX17)
${source_file} ${source_file}
) )
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
msgpackc-cxx msgpack-cxx
) )
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra") SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")

View File

@@ -15,7 +15,7 @@ IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
${source_file_we} ${source_file_we}
${source_file} ${source_file}
) )
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE msgpackc-cxx) TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE msgpack-cxx)
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra") SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
@@ -40,7 +40,7 @@ IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
${source_file} ${source_file}
) )
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
msgpackc-cxx msgpack-cxx
Boost::context Boost::context
Boost::system Boost::system
Threads::Threads Threads::Threads

View File

@@ -16,7 +16,7 @@ FOREACH (source_file ${check_PROGRAMS})
$<IF:$<BOOL:${MSGPACK_USE_STATIC_BOOST}>,,BOOST_TEST_DYN_LINK>) $<IF:$<BOOL:${MSGPACK_USE_STATIC_BOOST}>,,BOOST_TEST_DYN_LINK>)
TARGET_LINK_LIBRARIES (${source_file_we} TARGET_LINK_LIBRARIES (${source_file_we}
msgpackc-cxx msgpack-cxx
Threads::Threads Threads::Threads
Boost::filesystem Boost::filesystem
Boost::system Boost::system

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700) #if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700) #if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)

View File

@@ -27,7 +27,7 @@ http://www.boost.org/LICENSE_1_0.txt)
#define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE #define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ #if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
defined(linux) || defined(__linux) \ defined(linux) || defined(__linux) || defined(__linux__) \
) )
# undef MSGPACK_OS_LINUX # undef MSGPACK_OS_LINUX
# define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_AVAILABLE # define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_AVAILABLE

View File

@@ -24,16 +24,22 @@
# define MSGPACK_PP_CONFIG_EDG() 0x0020 # define MSGPACK_PP_CONFIG_EDG() 0x0020
# define MSGPACK_PP_CONFIG_DMC() 0x0040 # define MSGPACK_PP_CONFIG_DMC() 0x0040
# #
# if !defined(__clang__) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
# define MSGPACK_TRADITIONAL_MSVC 1
# else
# define MSGPACK_TRADITIONAL_MSVC 0
# endif
#
# ifndef MSGPACK_PP_CONFIG_FLAGS # ifndef MSGPACK_PP_CONFIG_FLAGS
# if defined(__GCCXML__) || defined(__WAVE__) || defined(__MWERKS__) && __MWERKS__ >= 0x3200 # if defined(__GCCXML__) || defined(__WAVE__) || defined(__MWERKS__) && __MWERKS__ >= 0x3200
# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT()) # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT())
# elif defined(__EDG__) || defined(__EDG_VERSION__) # elif defined(__EDG__) || defined(__EDG_VERSION__)
# if defined(_MSC_VER) && !defined(__clang__) && (defined(__INTELLISENSE__) || __EDG_VERSION__ >= 308) # if defined(_MSC_VER) && MSGPACK_TRADITIONAL_MSVC && (defined(__INTELLISENSE__) || __EDG_VERSION__ >= 308)
# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_MSVC()) # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_MSVC())
# else # else
# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_EDG() | MSGPACK_PP_CONFIG_STRICT()) # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_EDG() | MSGPACK_PP_CONFIG_STRICT())
# endif # endif
# elif defined(_MSC_VER) && defined(__clang__) # elif defined(_MSC_VER) && !MSGPACK_TRADITIONAL_MSVC
# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT()) # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_STRICT())
# elif defined(__MWERKS__) # elif defined(__MWERKS__)
# define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_MWCC()) # define MSGPACK_PP_CONFIG_FLAGS() (MSGPACK_PP_CONFIG_MWCC())
@@ -75,7 +81,7 @@
# define MSGPACK_PP_VARIADICS 0 # define MSGPACK_PP_VARIADICS 0
# elif defined(__CUDACC__) # elif defined(__CUDACC__)
# define MSGPACK_PP_VARIADICS 1 # define MSGPACK_PP_VARIADICS 1
# elif defined(_MSC_VER) && defined(__clang__) # elif defined(_MSC_VER) && !MSGPACK_TRADITIONAL_MSVC
# define MSGPACK_PP_VARIADICS 1 # define MSGPACK_PP_VARIADICS 1
# /* VC++ (C/C++) and Intel C++ Compiler >= 17.0 with MSVC */ # /* VC++ (C/C++) and Intel C++ Compiler >= 17.0 with MSVC */
# elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__) || defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) # elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__) || defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700)
@@ -94,7 +100,7 @@
# elif !MSGPACK_PP_VARIADICS + 1 < 2 # elif !MSGPACK_PP_VARIADICS + 1 < 2
# undef MSGPACK_PP_VARIADICS # undef MSGPACK_PP_VARIADICS
# define MSGPACK_PP_VARIADICS 1 # define MSGPACK_PP_VARIADICS 1
# if defined _MSC_VER && _MSC_VER >= 1400 && !defined(__clang__) && (defined(__INTELLISENSE__) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) || !(defined __EDG__ || defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || defined __SUNPRO_CC || defined __HP_aCC || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI)) # if defined _MSC_VER && _MSC_VER >= 1400 && MSGPACK_TRADITIONAL_MSVC && (defined(__INTELLISENSE__) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) || !(defined __EDG__ || defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || defined __SUNPRO_CC || defined __HP_aCC || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI))
# undef MSGPACK_PP_VARIADICS_MSVC # undef MSGPACK_PP_VARIADICS_MSVC
# define MSGPACK_PP_VARIADICS_MSVC 1 # define MSGPACK_PP_VARIADICS_MSVC 1
# endif # endif

View File

@@ -88,7 +88,7 @@
#elif defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__) #elif defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__)
#include <arpa/inet.h> /* __BYTE_ORDER */ #include <arpa/inet.h> /* __BYTE_ORDER */
# if defined(linux) # if defined(linux) || defined(__linux__)
# include <byteswap.h> # include <byteswap.h>
# endif # endif

View File

@@ -36,7 +36,11 @@
#include "adaptor/cpp11/array.hpp" #include "adaptor/cpp11/array.hpp"
#include "adaptor/cpp11/array_char.hpp" #include "adaptor/cpp11/array_char.hpp"
#include "adaptor/cpp11/array_unsigned_char.hpp" #include "adaptor/cpp11/array_unsigned_char.hpp"
#if !defined(MSGPACK_NO_BOOST)
#include "adaptor/cpp11/chrono.hpp" #include "adaptor/cpp11/chrono.hpp"
#endif // !defined(MSGPACK_NO_BOOST)
#include "adaptor/cpp11/forward_list.hpp" #include "adaptor/cpp11/forward_list.hpp"
#include "adaptor/cpp11/reference_wrapper.hpp" #include "adaptor/cpp11/reference_wrapper.hpp"
#include "adaptor/cpp11/shared_ptr.hpp" #include "adaptor/cpp11/shared_ptr.hpp"

View File

@@ -12,6 +12,7 @@
#include "msgpack/versioning.hpp" #include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp" #include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/object.hpp"
namespace msgpack { namespace msgpack {

View File

@@ -12,6 +12,7 @@
#include "msgpack/versioning.hpp" #include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp" #include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/object.hpp"
namespace msgpack { namespace msgpack {

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include "msgpack/meta.hpp" #include "msgpack/meta.hpp"

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include "msgpack/adaptor/boost/string_ref.hpp" #include "msgpack/adaptor/boost/string_ref.hpp"
#include "msgpack/adaptor/ext.hpp" #include "msgpack/adaptor/ext.hpp"

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#if defined(__GNUC__) #if defined(__GNUC__)

View File

@@ -15,6 +15,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <boost/utility/string_ref.hpp> #include <boost/utility/string_ref.hpp>

View File

@@ -15,6 +15,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <boost/utility/string_view.hpp> #include <boost/utility/string_view.hpp>

View File

@@ -13,6 +13,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include "msgpack/meta.hpp" #include "msgpack/meta.hpp"

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <array> #include <array>

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <array> #include <array>

View File

@@ -11,8 +11,11 @@
#ifndef MSGPACK_V1_TYPE_CPP11_CHRONO_HPP #ifndef MSGPACK_V1_TYPE_CPP11_CHRONO_HPP
#define MSGPACK_V1_TYPE_CPP11_CHRONO_HPP #define MSGPACK_V1_TYPE_CPP11_CHRONO_HPP
#if !defined(MSGPACK_NO_BOOST)
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <chrono> #include <chrono>
@@ -247,4 +250,6 @@ struct object_with_zone<std::chrono::time_point<Clock, Duration>> {
} // namespace msgpack } // namespace msgpack
#endif // !defined(MSGPACK_NO_BOOST)
#endif // MSGPACK_V1_TYPE_CPP11_CHRONO_HPP #endif // MSGPACK_V1_TYPE_CPP11_CHRONO_HPP

View File

@@ -13,6 +13,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <forward_list> #include <forward_list>

View File

@@ -13,6 +13,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <memory> #include <memory>

View File

@@ -13,6 +13,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <memory> #include <memory>

View File

@@ -13,6 +13,7 @@
#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>

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include "msgpack/meta.hpp" #include "msgpack/meta.hpp"

View File

@@ -13,6 +13,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <memory> #include <memory>

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <unordered_map> #include <unordered_map>

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <unordered_set> #include <unordered_set>

View File

@@ -16,6 +16,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <array> #include <array>

View File

@@ -16,6 +16,7 @@
#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/adaptor/adaptor_base.hpp" #include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/adaptor/int_decl.hpp" #include "msgpack/adaptor/int_decl.hpp"
#include "msgpack/object.hpp" #include "msgpack/object.hpp"

View File

@@ -16,6 +16,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <cstring> #include <cstring>

View File

@@ -16,6 +16,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <optional> #include <optional>

View File

@@ -16,6 +16,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <string_view> #include <string_view>

View File

@@ -16,6 +16,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <vector> #include <vector>

View File

@@ -18,6 +18,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include "msgpack/meta.hpp" #include "msgpack/meta.hpp"

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <deque> #include <deque>

View File

@@ -12,6 +12,7 @@
#include "msgpack/versioning.hpp" #include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp" #include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/object.hpp"
namespace msgpack { namespace msgpack {
/// @cond /// @cond

View File

@@ -12,6 +12,7 @@
#include "msgpack/versioning.hpp" #include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp" #include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/object.hpp"
namespace msgpack { namespace msgpack {
/// @cond /// @cond

View File

@@ -12,6 +12,7 @@
#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 <cstring> #include <cstring>
#include <string> #include <string>

View File

@@ -12,6 +12,7 @@
#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/adaptor/int.hpp" #include "msgpack/adaptor/int.hpp"
namespace msgpack { namespace msgpack {

View File

@@ -12,6 +12,7 @@
#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 <limits> #include <limits>
namespace msgpack { namespace msgpack {

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <list> #include <list>

View File

@@ -12,6 +12,7 @@
#include "msgpack/versioning.hpp" #include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp" #include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/object.hpp"
namespace msgpack { namespace msgpack {

View File

@@ -12,6 +12,7 @@
#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/meta.hpp" #include "msgpack/meta.hpp"
#include <utility> #include <utility>

View File

@@ -12,6 +12,7 @@
#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 <cstring> #include <cstring>
#include <string> #include <string>

View File

@@ -12,6 +12,7 @@
#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/adaptor/msgpack_tuple.hpp" #include "msgpack/adaptor/msgpack_tuple.hpp"
namespace msgpack { namespace msgpack {

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <string> #include <string>

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700) #if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700) #if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700)

View File

@@ -12,6 +12,7 @@
#include "msgpack/versioning.hpp" #include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp" #include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/object.hpp"
namespace msgpack { namespace msgpack {

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <vector> #include <vector>

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <vector> #include <vector>

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <vector> #include <vector>

View File

@@ -12,6 +12,7 @@
#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/adaptor/check_container_size.hpp" #include "msgpack/adaptor/check_container_size.hpp"
#include <vector> #include <vector>

View File

@@ -138,7 +138,7 @@ class zone {
finalizer_array m_finalizer_array; finalizer_array m_finalizer_array;
public: public:
zone(size_t chunk_size = MSGPACK_ZONE_CHUNK_SIZE) /* throw() */; zone(size_t chunk_size = MSGPACK_ZONE_CHUNK_SIZE);
public: public:
void* allocate_align(size_t size, size_t align = MSGPACK_ZONE_ALIGN); void* allocate_align(size_t size, size_t align = MSGPACK_ZONE_ALIGN);
@@ -239,7 +239,7 @@ private:
zone& operator=(const zone&); zone& operator=(const zone&);
}; };
inline zone::zone(size_t chunk_size) /* throw() */ :m_chunk_size(chunk_size), m_chunk_list(m_chunk_size) inline zone::zone(size_t chunk_size):m_chunk_size(chunk_size), m_chunk_list(m_chunk_size)
{ {
} }

View File

@@ -171,7 +171,7 @@ private:
finalizer_array m_finalizer_array; finalizer_array m_finalizer_array;
public: public:
zone(size_t chunk_size = MSGPACK_ZONE_CHUNK_SIZE) noexcept; zone(size_t chunk_size = MSGPACK_ZONE_CHUNK_SIZE);
public: public:
void* allocate_align(size_t size, size_t align = MSGPACK_ZONE_ALIGN); void* allocate_align(size_t size, size_t align = MSGPACK_ZONE_ALIGN);
@@ -226,7 +226,7 @@ private:
char* allocate_expand(size_t size); char* allocate_expand(size_t size);
}; };
inline zone::zone(size_t chunk_size) noexcept:m_chunk_size(chunk_size), m_chunk_list(m_chunk_size) inline zone::zone(size_t chunk_size):m_chunk_size(chunk_size), m_chunk_list(m_chunk_size)
{ {
} }

View File

@@ -1138,6 +1138,17 @@ inline packer<Stream>& packer<Stream>::pack_unsigned_long_long(unsigned long lon
template <typename Stream> template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_float(float d) inline packer<Stream>& packer<Stream>::pack_float(float d)
{ {
if(d == d) { // check for nan
// compare d to limits to avoid undefined behaviour
if(d >= 0 && d <= float(std::numeric_limits<uint64_t>::max()) && d == float(uint64_t(d))) {
pack_imp_uint64(uint64_t(d));
return *this;
} else if(d < 0 && d >= float(std::numeric_limits<int64_t>::min()) && d == float(int64_t(d))) {
pack_imp_int64(int64_t(d));
return *this;
}
}
union { float f; uint32_t i; } mem; union { float f; uint32_t i; } mem;
mem.f = d; mem.f = d;
char buf[5]; char buf[5];
@@ -1149,6 +1160,17 @@ inline packer<Stream>& packer<Stream>::pack_float(float d)
template <typename Stream> template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_double(double d) inline packer<Stream>& packer<Stream>::pack_double(double d)
{ {
if(d == d) { // check for nan
// compare d to limits to avoid undefined behaviour
if(d >= 0 && d <= double(std::numeric_limits<uint64_t>::max()) && d == double(uint64_t(d))) {
pack_imp_uint64(uint64_t(d));
return *this;
} else if(d < 0 && d >= double(std::numeric_limits<int64_t>::min()) && d == double(int64_t(d))) {
pack_imp_int64(int64_t(d));
return *this;
}
}
union { double f; uint64_t i; } mem; union { double f; uint64_t i; } mem;
mem.f = d; mem.f = d;
char buf[9]; char buf[9];

View File

@@ -10,6 +10,7 @@
#ifndef MSGPACK_V1_SBUFFER_HPP #ifndef MSGPACK_V1_SBUFFER_HPP
#define MSGPACK_V1_SBUFFER_HPP #define MSGPACK_V1_SBUFFER_HPP
#include "msgpack/v1/cpp_config_decl.hpp"
#include "msgpack/v1/sbuffer_decl.hpp" #include "msgpack/v1/sbuffer_decl.hpp"
#include "msgpack/assert.hpp" #include "msgpack/assert.hpp"

View File

@@ -12,6 +12,7 @@
#include "msgpack/versioning.hpp" #include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp" #include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/object.hpp"
namespace msgpack { namespace msgpack {

View File

@@ -12,6 +12,7 @@
#include "msgpack/versioning.hpp" #include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp" #include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/object.hpp"
namespace msgpack { namespace msgpack {

View File

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

View File

@@ -2,7 +2,7 @@
find include -name "*.hpp" -or -name "*.h" | sed -e 's/\s\+/\n/g' | LC_ALL=C sort > cpp_headers.tmp find include -name "*.hpp" -or -name "*.h" | sed -e 's/\s\+/\n/g' | LC_ALL=C sort > cpp_headers.tmp
echo 'SET (msgpackc_HEADERS' > Files.cmake echo 'SET (msgpack-cxx_HEADERS' > Files.cmake
cat cpp_headers.tmp | sed -e 's/^/ /g' >> Files.cmake cat cpp_headers.tmp | sed -e 's/^/ /g' >> Files.cmake
echo ')' >> Files.cmake echo ')' >> Files.cmake

View File

@@ -32,7 +32,7 @@ tar --append --file=$filename $prefix/ChangeLog
tar --append --file=$filename $prefix/NEWS tar --append --file=$filename $prefix/NEWS
tar --append --file=$filename $prefix/COPYING tar --append --file=$filename $prefix/COPYING
tar --append --file=$filename $prefix/README tar --append --file=$filename $prefix/README
tar --append --file=$filename $prefix/msgpack-config.cmake.in tar --append --file=$filename $prefix/msgpack-cxx-config.cmake.in
rm -f $prefix rm -f $prefix
gzip -f $filename gzip -f $filename

View File

@@ -1,9 +0,0 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Boost REQUIRED)
include("${CMAKE_CURRENT_LIST_DIR}/msgpackc-cxx-targets.cmake")
check_required_components(msgpackc-cxx)

View File

@@ -0,0 +1,11 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
IF (@MSGPACK_USE_BOOST@)
find_dependency(Boost REQUIRED)
ENDIF ()
include("${CMAKE_CURRENT_LIST_DIR}/msgpack-cxx-targets.cmake")
check_required_components(msgpack-cxx)

View File

@@ -4,7 +4,7 @@ project(test-install LANGUAGES CXX)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(msgpack REQUIRED) find_package(msgpack-cxx REQUIRED)
add_executable(test-install simple.cpp) add_executable(test-install simple.cpp)
target_link_libraries(test-install PRIVATE msgpackc-cxx) target_link_libraries(test-install PRIVATE msgpack-cxx)

View File

@@ -78,7 +78,7 @@ FOREACH (source_file ${check_PROGRAMS})
$<IF:$<BOOL:${MSGPACK_USE_STATIC_BOOST}>,,BOOST_TEST_DYN_LINK>) $<IF:$<BOOL:${MSGPACK_USE_STATIC_BOOST}>,,BOOST_TEST_DYN_LINK>)
TARGET_LINK_LIBRARIES (${source_file_we} TARGET_LINK_LIBRARIES (${source_file_we}
msgpackc-cxx msgpack-cxx
Boost::system Boost::system
Boost::unit_test_framework Boost::unit_test_framework
Threads::Threads Threads::Threads
@@ -109,7 +109,7 @@ ADD_EXECUTABLE (
) )
TARGET_LINK_LIBRARIES (multi_file TARGET_LINK_LIBRARIES (multi_file
msgpackc-cxx msgpack-cxx
) )
ADD_TEST (multi_file multi_file) ADD_TEST (multi_file multi_file)

View File

@@ -154,6 +154,8 @@ BOOST_AUTO_TEST_CASE(simple_buffer_float)
v.push_back(-0.0); v.push_back(-0.0);
v.push_back(1.0); v.push_back(1.0);
v.push_back(-1.0); v.push_back(-1.0);
v.push_back(1.1f);
v.push_back(-1.1f);
v.push_back(numeric_limits<float>::min()); v.push_back(numeric_limits<float>::min());
v.push_back(numeric_limits<float>::max()); v.push_back(numeric_limits<float>::max());
v.push_back(nanf("tag")); v.push_back(nanf("tag"));
@@ -186,6 +188,12 @@ BOOST_AUTO_TEST_CASE(simple_buffer_float)
BOOST_CHECK(std::isinf(val2)); BOOST_CHECK(std::isinf(val2));
else else
BOOST_CHECK(fabs(val2 - val1) <= kEPS); BOOST_CHECK(fabs(val2 - val1) <= kEPS);
// check for compact storing of float
if (val1 == val1 && val1 >= float(std::numeric_limits<int64_t>::min()) && val1 <= float(std::numeric_limits<int64_t>::max()) && val1 == float(int64_t(val1)))
BOOST_REQUIRE_EQUAL(sbuf.size(),1);
else
BOOST_REQUIRE_EQUAL(sbuf.data()[0],char(0xca));
} }
} }
@@ -236,6 +244,8 @@ BOOST_AUTO_TEST_CASE(simple_buffer_double)
v.push_back(-0.0); v.push_back(-0.0);
v.push_back(1.0); v.push_back(1.0);
v.push_back(-1.0); v.push_back(-1.0);
v.push_back(1.1);
v.push_back(-1.1);
v.push_back(numeric_limits<double>::min()); v.push_back(numeric_limits<double>::min());
v.push_back(numeric_limits<double>::max()); v.push_back(numeric_limits<double>::max());
v.push_back(nanf("tag")); v.push_back(nanf("tag"));
@@ -272,6 +282,12 @@ BOOST_AUTO_TEST_CASE(simple_buffer_double)
BOOST_CHECK(std::isinf(val2)); BOOST_CHECK(std::isinf(val2));
else else
BOOST_CHECK(fabs(val2 - val1) <= kEPS); BOOST_CHECK(fabs(val2 - val1) <= kEPS);
// check for compact storing of double
if (val1 == val1 && val1 >= double(std::numeric_limits<int64_t>::min()) && val1 <= double(std::numeric_limits<int64_t>::max()) && val1 == double(int64_t(val1)))
BOOST_REQUIRE_EQUAL(sbuf.size(),1);
else
BOOST_REQUIRE_EQUAL(uint8_t(sbuf.data()[0]),uint8_t(0xcb));
} }
} }

View File

@@ -861,6 +861,8 @@ BOOST_AUTO_TEST_CASE(no_def_con_array_simple_buffer)
BOOST_CHECK(val1 == val2); BOOST_CHECK(val1 == val2);
} }
#if !defined(MSGPACK_NO_BOOST)
BOOST_AUTO_TEST_CASE(system_clock) BOOST_AUTO_TEST_CASE(system_clock)
{ {
std::chrono::system_clock::time_point val1; std::chrono::system_clock::time_point val1;
@@ -1426,6 +1428,8 @@ BOOST_AUTO_TEST_CASE(high_resolution_clock_impl_now)
BOOST_CHECK(val1 == val3); BOOST_CHECK(val1 == val3);
} }
#endif // !defined(MSGPACK_NO_BOOST)
BOOST_AUTO_TEST_CASE(timespec_pack_convert_zero) BOOST_AUTO_TEST_CASE(timespec_pack_convert_zero)
{ {

View File

@@ -917,6 +917,8 @@ BOOST_AUTO_TEST_CASE(tuple_empty)
BOOST_CHECK(obj.as<test_t>() == v); BOOST_CHECK(obj.as<test_t>() == v);
} }
#if !defined(MSGPACK_NO_BOOST)
BOOST_AUTO_TEST_CASE(system_clock) BOOST_AUTO_TEST_CASE(system_clock)
{ {
std::chrono::system_clock::time_point v; std::chrono::system_clock::time_point v;
@@ -981,6 +983,8 @@ BOOST_AUTO_TEST_CASE(system_clock_impl_max)
BOOST_CHECK(obj.as<std::chrono::system_clock::time_point>() == v); BOOST_CHECK(obj.as<std::chrono::system_clock::time_point>() == v);
} }
#endif // !defined(MSGPACK_NO_BOOST)
#endif // !defined(MSGPACK_USE_CPP03) #endif // !defined(MSGPACK_USE_CPP03)
BOOST_AUTO_TEST_CASE(ext_empty) BOOST_AUTO_TEST_CASE(ext_empty)