981 Commits

Author SHA1 Message Date
PeizeLin
a56bad8bbb
Fix std::array<T,0> (#848)
* Fix std::array<T,0>

* Add unittests for std::array<T,0>

* update std::array
2025-01-19 21:00:41 -08:00
sjrdc
b4703c47ec Bump XCode versions 2025-01-19 19:00:00 -08:00
psykose
2c647d87d4 fix building tests when char is unsigned
when char is unsigned it's uint8_t which doesn't match the type declared
for the key of the map, so it fails with

error: non-constant-expression cannot be narrowed from type
'typename std::enable_if<std::is_integral<char>::value && sizeof(char) == sizeof(char), char>::type'
(aka 'char') to 'const signed char' in initializer list

etc
2024-12-23 18:09:09 -08:00
Diego Mateos
f7deca361c More robust __cplusplus check
Similar to the same check done a few lines above for c++17
2024-12-23 18:07:48 -08:00
Douglas Scofield
cb6c6ac1f0 create pkgconfig file during build 2024-12-23 18:03:55 -08:00
Shane Grant
864c2fc370 Merge branch 'sjrdc-master' 2024-12-22 12:24:11 -08:00
sjrdc
66d74f8cb9 Fix linux CI #846
- Does not address Mac/windows builds
2024-12-22 12:22:49 -08:00
Lukas Hübner
d1fcec807b Fix some typos (spelling) 2023-06-14 20:18:40 -07:00
Khem Raj
f3e31f32f7 sandbox: Do not use int8_t in std::uniform_int_distribution
Newer versions of libc++ has dropped supporting this usecase since its
an UB see.

https://reviews.llvm.org/D114920?id=400571

Fixes

uniform_int_distribution.h:162:5: error: static assertion failed due to requirement '__libcpp_random_is_valid_inttype<char>::value': IntType must be a supported integer type
    static_assert(__libcpp_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libcereal/1.3.2+gitAUTOINC+ebef1e9298-r0/git/sandbox/performance.cpp:261:9: note: in instantiation of template class 'std::uniform_int_distribution<char>' requested here
    c = std::uniform_int_distribution<char>(' ', '~')(gen);
        ^
/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libcereal/1.3.2+gitAUTOINC+ebef1e9298-r0/git/sandbox/performance.cpp:261:9: error: type 'std::uniform_int_distribution<char>' does not provide a call operator
    c = std::uniform_int_distribution<char>(' ', '~')(gen);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-04-23 20:09:18 -07:00
astralaster
83b6fa06a0 Add ARCH_INDEPENDENT flag in CMakeLists.txt
If this package is flagged as ARCH_IDENPENDENT by cmake it is possible to consume the generated cmake files for compiling both 32bit and 64bit projects. Otherwise cmake will complain:
CMake Error at CMakeLists.txt:12 (find_package):
  Could not find a configuration file for package "cereal" that is compatible
  with requested version "".

  The following configuration files were considered but not accepted:

   cmake/cereal/cerealConfig.cmake, version: 1.3.2 (64bit)

Ive also added a version check to retain the compability with cmake
older than 3.14.

For more info about this flag look here:
https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html
2023-04-23 20:03:11 -07:00
Alex Fan
b2d68c522b auto enable SKIP_PORTABILITY_TEST
also avoid unused CMake variable warning
2023-04-23 19:45:01 -07:00
Jan Niklas Hasse
ddd4672447 Remove extra ; after member function definition
Triggered by -Wextra-semi.
2022-03-27 14:54:17 -07:00
Luca Ciucci
5b37553aa9 ST renamed to AlignedStorage 2022-03-14 13:29:59 -07:00
Luca Ciucci
343473b752 Update .gitignore
`.vs/` folder is created by Visual Studio and it is not needed.
2022-03-14 13:29:59 -07:00
CHP
45e40375b6
Fix long long json serialization (#728)
* Fix long long json serialization

* Update pod.hpp
2022-03-14 13:29:42 -07:00
Shane Grant
ebef1e9298 Correct patch version for 1.3.2 v1.3.2 2022-02-27 19:46:32 -08:00
Shane Grant
6e1c66a94c Add CMake options for building doc and sandbox
relates #739
2022-02-27 19:43:25 -08:00
Michael R. Crusoe
39d202053d Make doxygen docs reproducible 2022-02-27 19:28:28 -08:00
Shane Grant
1de8fe8947 Update version to 1.3.1 v1.3.1 2022-01-16 21:54:56 -08:00
Anton Blanchard
107f8c2aa9 Use GNUInstallDirs instead of hard wiring install directories
On a multilib setup cmake files should go into lib64.
2022-01-16 20:59:04 -08:00
Shane Grant
ca9aeaab27 Update doctest to 2.4.7, update CI, add badges
Updates doctest and fixes issues with g++4.7 and MSVC2013 doctest
builds.

Adds new CI targets for g++ 9 and 10, clang 9 through 12.

Adds CI badges for github actions.
2022-01-10 23:00:57 -08:00
Shane Grant
8291f44e05 Update license to match BSD template 2022-01-09 17:05:35 -08:00
Darred
de953044b0 Fixed loading of std::vector<bool>
We should use auto && instead of auto if we want to modify v inside the for loop.
2022-01-09 16:13:35 -08:00
Shane Grant
408a351ce0 Update appveyor to build with MSVC 2022 and fix boost 2021-11-28 22:01:00 -08:00
Shane Grant
90ea8a98c5 Update doctest to 2.4.6 dev + local fixes slated for upstream 2021-11-28 22:01:00 -08:00
Isuru Fernando
2c5e1b792f Add github actions workflow
use docker containers
remove sudo
install software-properties-common
update before trying install
install wget
cmake and make
install cmake from pip
add apt-transport-https
Use llvm xenial
Fix clang package name
Fix boost with gcc<5
verbose compile
skip boost for gcc<5
macos test
skip boost for macos
test different xcode compilers
use new cmake syntax for selecting platform
no xcode 10 installed
Rename tests
2021-11-28 22:01:00 -08:00
Gary Heckman
af0700efb2 Fix itsNextName not clearing when not found
An issue exists when loading vectors of objects where, if the last nvp of
the previous object does not exist in the json file, the itsNextName
variable within the json serializer is not cleared. This causes the vector
serializer to search for that name next (when it should be searching for a
nameless object.) The json serializer then throws during the named search.

Mild reworking of itsNextName solution
2021-09-20 18:23:34 -07:00
logan
f8338dbb73 Use std::optional::emplace() when loading to construct and load the contained value directly in place 2021-09-17 11:09:39 -07:00
logan
0bbbb142f9 Use std::variant::emplace when loading 2021-09-17 11:08:43 -07:00
Shane Peelar
46a4a91007 C++17: use inline globals for StaticObjects
This prevents multiple definition errors in Clang,
and also stops dllexporting functions with internal
linkage.  Degrades gracefully when C++17 is not
present.

Fix #595
Fix #652
Fix #582
Fix #643
2021-05-05 15:26:18 -07:00
John Keeping
e735cc8bc1 Catch short documents in JSON input
When reading unnamed fields from JSON input, the member/value iterators
are incremented blind without checking if the end of the iterator has
been reached.

Record the size so that this can be checked against the current position
to ensure reading doesn't walk off the end of the iterator.
2021-05-05 15:24:28 -07:00
Shane Grant
6d1c2885f2
Update README.md
Fix link to main website
2021-05-05 15:22:35 -07:00
Adam Miartus
64f50dbd5c add license files for components of cereal
Signed-off-by: Adam Miartus <adam.miartus@softhows.eu>
2021-02-01 15:51:18 -08:00
Michael Walz
f27c12d491
Store a copy of each serialized shared_ptr within the archive to prevent the shared_ptr to be freed to early. (#667)
The archives use the memory address pointed by the shared_ptr as a
unique id which must not be reused during lifetime of the archive.
Therefore, the archives stores a copy of it.
This problem was also reported as CVE-2020-11105.
2021-02-01 15:50:29 -08:00
Claus Klein
48fda3f0a6
cleanup cmake files to be a little more moderen (#659)
* cleanup cmake files to be a little more moderen

keep the source tree free of build artifacts
cmakelint the cmake files too

* fix cmake setup errors on CI

fix APPLE clang builds too

* CI needs support for realy history cmake V3.6

fix typo in cmake files using add_test() commnds

* One step more to use modern cmake

Prevent to modifiy compile and linker FLAGS and to set global includes
pathes

* fix CI build problems with older cmake versions

prepare cleanup cmake list file

* final cleanup

use Config.cmake.in and install hole cmake config files

* Fix cpp17 PORTABILITY_TEST linker problem

add missed target_link_libraries()

* hopefully prevent windows test problems
2020-11-17 12:50:06 -08:00
John Alexander
562321c354
Fixes to prevent clang-diagnostic errors (#643)
* Fixes to prevent clang-diagnostic when running clang-tidy with Microsoft Visual Studio cmake projects.

* Used boolean rather than bitwise operator.
2020-10-28 09:43:22 -07:00
groscoe2
b5e17a9159
Fix rapidjson for Clang 10 (#645)
Based on Tencent/rapidjson#1679
Addresses USCiLab/cereal#631
2020-10-28 09:42:33 -07:00
Łukasz Gemborowski
3e4d1b84ca
[cpp20] explicitly capture 'this' as copy (#640)
implicit 'this' capture is deprecated in C++20
2020-04-23 09:43:10 -07:00
Bernard Blackham
10d9a29c22
Fix json.hpp compilation issue when int32_t is a long (#621)
When testing whether or not to define a saveValue() overload
for long, test the actual set of types implemented.
2020-04-22 14:36:07 -07:00
Shane Grant
a5a3095312
Add MSVC 2019 to build, default ctor for static object (#593)
relates #592
2019-12-29 11:07:53 -08:00
Shane Grant
075c44feef
Merge pull request #597 from tankorsmash/patch-1
Fix typo in docs
2019-11-17 17:55:43 -08:00
TankorSmash
8bd726281f
Fix typo in docs 2019-11-12 16:29:18 -05:00
Shane Grant
02eace19a9 Badges for travis and appveyor v1.3.0 2019-10-24 21:38:52 -07:00
Shane Grant
37b4567934 Merge branch 'develop' for release 1.3.0 2019-10-24 21:35:23 -07:00
Shane Grant
021e5da2fe Update version to 1.3.0 2019-10-24 21:20:51 -07:00
Shane Grant
49fbbed8e2 Merge branch 'update_rapidjson' into develop
see #579
2019-10-23 22:15:16 -07:00
Shane Grant
1bce4362db Add option to disable performance test build 2019-10-23 22:06:18 -07:00
Shane Grant
797239531b Remove vs2013 directory in favor of using cmake 2019-10-23 22:06:18 -07:00
Shane Grant
0db8d115bf Documentation updates 2019-10-23 22:06:18 -07:00
Shane Grant
4b466f4f80 clang warning updates for sandbox code 2019-10-23 22:06:18 -07:00