309 Commits

Author SHA1 Message Date
Stephan Lachnit
3788b5ba63
Revert "Merge pull request #1018 from GeorgFritze/cpp_master"
This reverts commit d13d933eea138215791c209456f38b8055d70cba, reversing
changes made to 05f654fd64de96fdb91d043a70de86a8f6149e9a.
2024-10-24 16:35:11 +02:00
Takatoshi Kondo
636a0130ba Conditional include msgpack::variant.
It uses boost::variant. boost::variant requires boost::tyoe_index.
boost::type index has dropped C++03 support.
2024-08-06 11:21:55 +09:00
Uy Ha
d812fa5edc Fix compilation error when std::variant has the same types 2024-04-02 01:23:25 +00:00
Takatoshi Kondo
91006555f1 Remove boost system requirement. 2023-10-03 10:51:29 +09:00
Takatoshi Kondo
cd7c5bcfec Remove Boost::system. 2023-10-03 10:51:29 +09:00
Takatoshi Kondo
1fb1dad6bc
Merge pull request #1076 from uyha/chrono-no-boost
remove dependency on boost in chrono.hpp
2023-07-06 09:11:42 +09:00
Uy Ha
35638ead37 fix style 2023-07-04 06:06:43 +00:00
Uy Ha
f2ffcf0b08 remove dependency on boost in chrono.hpp 2023-07-03 20:05:06 +00:00
Uy Ha
211c50c755 enhance error handling, implement object_with_zone, and add more tests 2023-07-03 16:17:12 +00:00
Uy Ha
327f3d1ad0 implement as and pack for std::variant 2023-07-03 13:37:37 +00:00
Takatoshi Kondo
34f8fd65bb Fixed #1070.
- msgpack::type::variant behaves as MessagePack format.
  e.g.)
  12.34  => double
  12.0   => uint64_t
  -12.34 => double
  -12.0  => int64_t
- msgpack::type::variant::as_double() can be used even if interval type is
  int64_t and/or uint64_t.
- msgpack::type::variant::as_*() don't return non const reference
  internal value.
- fix coding style
2023-05-14 10:12:21 +09:00
Arsen Arsenović
2dd3dbc85f
test: Add missing rebind to allocators
See https://gcc.gnu.org/gcc-13/porting_to.html
2023-04-18 15:50:52 +02: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
GeorgFritze
33ff3a45b8 fix undefined bahaviour in msgpack_basic tests 2022-06-13 10:58:45 +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
Takatoshi Kondo
e596b6fe35 Remove chrono support on MSGPACK_NO_BOOST. 2022-03-09 12:55:17 +09:00
Takatoshi Kondo
066d509a68 Minimall supported build without boost.
To remove boost dependency, `-DMSGPACK_USE_BOOST=OFF` for cmake.
By default, `-DMSGPACK_USE_BOOST` is `ON`.
NOTE: In order to build tests `-DMSGPACK_USE_BOOST=ON` is required.

For C++ compiler, the option `-DMSGPACK_NO_BOOST` is required to remove
boost.
2022-02-07 22:32:59 +09:00
Takatoshi Kondo
af9ce1b627 Fixed test warning. 2021-10-23 12:17:34 +09:00
Takatoshi Kondo
c0708dbcba
Merge pull request #972 from kovdan01/fix_fuzz_running
Fix #969
2021-08-31 09:24:20 +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
860f7fce55 Ported #962 to C++.
Improved alignment calculation logic.
Fixed test for zone.
Now, align parameter must be 2^n (n >=0). e.g. 1,2,4,8,16, ...
2021-08-29 13:46:51 +09:00
Daniil Kovalev
4022c2fc00 Fix appveyor build 2021-07-04 13:25:25 +03:00
Daniil Kovalev
7b7615a6d9
Modernize codebase
- Enhance CMakeLists.txt files.
- Move to Boost Test from Google Test to support pre-C++11 compilers.
- Add more configurations on CI matrix builds.
- Other minor fixes
2021-07-01 18:17:20 +03:00
Daniil Kovalev
2b78d50d13 Fix build with C++17 or lower 2021-05-10 22:48:19 +03:00
Daniil Kovalev
77045f13bb Add tests for std::span adaptor 2021-05-10 22:41:10 +03:00
Daniil Kovalev
388891edad Add support for more binary buffer types
Add support for the following types:
- `std::array<std::byte>`
- `std::span<char>`
- `std::span<unsigned char>`
- `std::span<std::byte>`
2021-05-10 16:06:26 +03:00
Daniil Kovalev
a66da75bd4 Fix iovec-related tests 2021-05-08 17:10:47 +03:00
Takatoshi Kondo
c8a053557c Propagated CXXFLAGS.
Fixed warnings.
2020-07-02 16:15:08 +09:00
Takatoshi Kondo
6eaf7fd38d Added steady_clock and high_resolution_clock support. 2020-06-12 22:16:19 +09:00
Takatoshi Kondo
3b80c45725 Added complex type support. 2020-06-10 13:26:40 +09:00
yuangongji
2f5b137997 remove C part in source code 2020-06-05 18:12:03 +08:00
yuangongji
689e6d053a remove C part files
remove the following files or folders:
ci/build_cmake_embedded.sh
example/c
example/cmake
include/msgpack/predef
include/msgpack/preprocessor.hpp
include/msgpack/preprocessor
include/msgpack/v1/preprocessor.hpp
include/msgpack.h
include/msgpack/fbuffer.h
include/msgpack/gcc_atomic.h
include/msgpack/object.h
include/msgpack/pack.h
include/msgpack/pack_define.h
include/msgpack/pack_template.h
include/msgpack/predef.h
include/msgpack/sbuffer.h
include/msgpack/timestamp.h
include/msgpack/unpack.h
include/msgpack/unpack_template.h
include/msgpack/util.h
include/msgpack/version.h
include/msgpack/vrefbuffer.h
include/msgpack/zbuffer.h
include/msgpack/zone.h
msgpack_vc8.sln
msgpack_vc8.vcproj
msgpack-config.cmake.in
msgpack.pc.in
src
test/fixint_c.cpp
test/msgpack_c.cpp
test/pack_unpack_c.cpp
test/streaming_c.cpp
.gitmodules
external
QUICKSTART-C.md
2020-06-05 16:44:51 +08:00
yuangongji
b1725d4007 vrefbuffer: set default ref_size and chunk_size 2020-04-30 19:26:07 +08:00
Igor Sadchenko
9a3cd0c951 Fixed many warnings/errors with macro __GNUC__(issue #850) 2020-03-26 02:03:25 +03:00
yuangongji
d9c5978958 add MSGPACK_CXX_ONLY option to build c++ libraries only 2020-02-19 09:07:16 +08:00
Takatoshi Kondo
0d7caecdb5 Fixed cmake condition.
If MSGPACK_CXX17 is ON then build MSGPACK_CXX11 target.
2020-01-06 13:04:14 +09:00
James McCoy
f8b0ad1766
Skip timespec_pack_convert_64bit_sec_max_nano on systems where tv_sec <= 32-bit 2020-01-05 21:38:52 -05:00
James McCoy
7ed7af90b6
Fix timespec_object.*_32bit_sec tests on 32-bit platforms
On 32-bit unix platforms, 0xffffffffUL is a 32-bit value so the compiler
complains about converting it to a signed value.

    /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: error: constant expression evaluates to 4294967295 which cannot be narrowed to type '__time_t' (aka 'long') [-Wc++11-narrowing]
        timespec val1{ 0xffffffffUL, 0 };
                       ^~~~~~~~~~~~
    /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: note: insert an explicit cast to silence this issue
        timespec val1{ 0xffffffffUL, 0 };
                       ^~~~~~~~~~~~
                       static_cast<__time_t>( )
    /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: warning: implicit conversion changes signedness: 'unsigned long' to '__time_t' (aka 'long') [-Wsign-conversion]
        timespec val1{ 0xffffffffUL, 0 };
                     ~ ^~~~~~~~~~~~

Since we're trying to test how the maximum 32-bit value that fits in
timespec.tv_sec is handled, directly use the maximum 32-bit value for
the appropriate (un)signed type used for timespec.tv_sec.

We don't just cast to the value, as the compiler suggests, because that
would result in an extremely negative value.
2020-01-05 21:38:45 -05:00
Takatoshi Kondo
befc3cdd0c Supressed C4309 on MSVC. 2019-12-25 14:59:40 +09:00
Takatoshi Kondo
2e2e93ba2e Added compiler checking to pragma. 2019-12-25 14:39:57 +09:00
Takatoshi Kondo
3b2bb56243 Fixed #825.
Added verbose option to windows CIs.
Added C compiler flag operation for MSVC.
Fixed invalid /WX flag matching on MSVC at test.
2019-12-25 14:24:24 +09:00
Takatoshi Kondo
f89f05b883
Merge pull request #821 from tsundre/fix-msgpack_checked_call
Correctly check return value of snprintf
2019-12-09 15:19:42 +09:00
Torleiv Sundre
a6bf728a5c Correctly check return value of snprintf
In MSGPACK_CHECKED_CALL, the return value of snprintf is incorrectly
assumed to mean success if it is less than or equal to the buffer size.
The call should only be considered a success if the return value is less
than the buffer size.

This commit adds two unit tests that illustrates the issue and fixes the
issue, making the unit tests pass.
2019-12-04 14:20:12 +01:00
David Carlier
698a482b67 c++11 unit tests silent warning fixes proposal. 2019-11-16 13:36:37 +00:00
Takatoshi Kondo
70f950ac05 Fixed #806.
Removed `ss.str().data()` (the type of ss is std::stringstream).
Introduced variable that is const reference of `ss.str()`.
2019-08-29 20:22:10 +09:00
Takatoshi Kondo
de99222801 Fixed warnings. 2019-05-27 17:35:22 +09:00
Takatoshi Kondo
d3fecce359 Added timespec support for C++11 or later. 2019-05-09 14:46:45 +09:00
Takatoshi Kondo
17267ed475 Added -Wconversion support for C++. 2019-03-25 19:48:39 +09:00
Takatoshi Kondo
530561eec0 Added tests for msgpack::object::clone().
Converting C++ types from cloned object after original zone is destroyed.
2019-02-12 12:53:00 +09:00