Skip to content

Commit e01b988

Browse files
committed
Merge branch 'develop'
* develop: (108 commits) removed unordered tests tests have been taken over by developers of boost unordered uploading changes regarding unordered ... uploading tweaks to CMakeLists.txt so accommodate static linking imported/implemented boost/serialization/variant and test_variant Remove serialization support from Boost.Unordered containers Fix invalid vptr access in extended_type_info_no_rtti constructor Fix invalid downcast in ~xml_oarchive_impl altered boost optional to depend only public interface functions declared in std::optional. adjusted test_optional to test serialization of both boost::optional and std::optional Revert "Add serialization for std::optional" fix new requirement - if assigment is not defaulted, copy can't be either Fix clang-cl regression introduced by #282 correction in previous merge Remove debug output from util/test.jam Fix Sub::operator== signature to avoid ambiguity errors in C++20 Remove C++03 from GHA, because Variant and LexicalCast no longer compile under C++03 incremement archive version number fix PR 274 fix PR 283 committing most pending PRs Replace static_cast with reinterpet_cast in interface_oarchive Update xml_escape::fill() to default assign bstart, bend to an empty string Use the first instance of bos during serialization (for the case when there are multiple instances) ...
2 parents 90e3ce2 + e4756b7 commit e01b988

File tree

160 files changed

+1818
-1730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+1818
-1730
lines changed

.github/workflows/posix.yml

Lines changed: 428 additions & 43 deletions
Large diffs are not rendered by default.

.github/workflows/windows.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- develop
99
- feature/**
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
env:
1216
LIBRARY: serialization
1317

@@ -17,30 +21,45 @@ jobs:
1721
fail-fast: false
1822
matrix:
1923
include:
20-
- toolset: msvc-14.1
21-
cxxstd: "14,17,latest"
24+
- toolset: msvc-14.0
25+
cxxstd: "11,14"
2226
addrmd: 32,64
23-
os: windows-2016
27+
os: windows-2019
2428
- toolset: msvc-14.2
2529
cxxstd: "14,17,latest"
2630
addrmd: 32,64
2731
os: windows-2019
32+
- toolset: msvc-14.3
33+
cxxstd: "17,20,latest"
34+
addrmd: 32,64
35+
os: windows-2022
36+
- toolset: clang-win
37+
cxxstd: "14,17,latest"
38+
addrmd: 32,64
39+
os: windows-2022
2840
- toolset: gcc
29-
cxxstd: "03,11,14,17,2a"
41+
cxxstd: "11,14,17,2a"
3042
addrmd: 64
3143
os: windows-2019
3244

3345
runs-on: ${{matrix.os}}
3446

3547
steps:
36-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v3
3749

3850
- name: Setup Boost
3951
shell: cmd
4052
run: |
53+
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
54+
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
55+
echo LIBRARY: %LIBRARY%
56+
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
57+
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
58+
echo GITHUB_REF: %GITHUB_REF%
4159
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
4260
set BOOST_BRANCH=develop
43-
if "%GITHUB_BASE_REF%" == "master" set BOOST_BRANCH=master
61+
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
62+
echo BOOST_BRANCH: %BOOST_BRANCH%
4463
cd ..
4564
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
4665
cd boost-root
@@ -54,4 +73,4 @@ jobs:
5473
shell: cmd
5574
run: |
5675
cd ../boost-root
57-
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release
76+
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=release

.gitignore

Whitespace-only changes.

CMake/CMakeLists.txt

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CMake build control file for Serialization Library tests
22

3-
cmake_minimum_required(VERSION 3.0)
3+
cmake_minimum_required(VERSION 3.5)
44

55
if (POLICY CMP0054)
66
cmake_policy (SET CMP0054 NEW)
@@ -16,27 +16,28 @@ project("serialization")
1616
# Compiler settings
1717
#
1818

19-
message(STATUS "compiler is ${CMAKE_CXX_COMPILER_ID}" )
19+
message(STATUS "C++ compiler is ${CMAKE_CXX_COMPILER_ID}" )
2020
add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
21+
message(STATUS "C compiler is ${CMAKE_C_COMPILER_ID}" )
2122

2223
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
24+
add_definitions( -std=c++11 )
2325
add_definitions( -ftemplate-depth=255 )
2426
# we use gcc to test for C++03 compatibility
25-
add_definitions( -std=c++03 )
26-
message(STATUS "compiler is g++ c++03")
2727
set(COMPILER_SUPPORTS_CXX11 FALSE)
2828
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" )
2929
add_definitions( /wd4996 )
30-
message(STATUS "compiler is MSVC")
3130
set(COMPILER_SUPPORTS_CXX11 TRUE)
3231
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" )
32+
add_definitions( -std=c++17 )
3333
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=300")
34-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
34+
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
3535
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
36+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
3637
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
3738
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3" )
3839
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -dead_strip")
39-
set(COMPILER_SUPPORTS_CXX11 FALSE)
40+
set(COMPILER_SUPPORTS_CXX11 TRUE)
4041
endif()
4142

4243
#
@@ -45,15 +46,12 @@ endif()
4546

4647
# Boost
4748

48-
# note: we're assuming that boost has been built with:
49-
# ./b2 toolset=clang-darwin link=static,shared variant=debug,release stage
50-
5149
#
5250
# Project settings
5351
#
5452
option(BUILD_SHARED_LIBS "Build Shared Libraries" true)
5553

56-
find_package(Boost 1.74 REQUIRED COMPONENTS system filesystem)
54+
find_package(Boost 1.82 REQUIRED COMPONENTS system filesystem)
5755

5856
if(NOT Boost_FOUND)
5957
message("Boost NOT Found!")
@@ -280,14 +278,10 @@ archive_test(test_list A)
280278
archive_test(test_list_ptrs A)
281279

282280
archive_test(test_map A)
283-
archive_test(test_map_boost_unordered A)
284281
CHECK_INCLUDE_FILE_CXX(hash_map HASH_MAP_FOUND)
285282
if(HASH_MAP_FOUND)
286283
archive_test(test_map_hashed A)
287284
endif()
288-
if(COMPILER_SUPPORTS_CXX11)
289-
archive_test(test_map_unordered A)
290-
endif()
291285
archive_test(test_mi)
292286
archive_test(test_multiple_ptrs A)
293287
archive_test(test_multiple_inheritance)
@@ -308,14 +302,10 @@ archive_test(test_recursion A)
308302
archive_test(test_registered)
309303

310304
archive_test(test_set A)
311-
archive_test(test_set_boost_unordered A)
312305
CHECK_INCLUDE_FILE_CXX(hash_set HASH_SET_FOUND)
313306
if(HASH_SET_FOUND)
314307
archive_test(test_set_hashed A)
315308
endif()
316-
if(COMPILER_SUPPORTS_CXX11)
317-
archive_test(test_set_unordered A)
318-
endif()
319309

320310
archive_test(test_shared_ptr)
321311
archive_test(test_shared_ptr_multi_base)
@@ -337,10 +327,12 @@ archive_test(test_valarray)
337327
archive_test(test_variant A)
338328
archive_test(test_vector A)
339329

340-
polymorphic_archive_test(test_dll_exported polymorphic_derived1)
341-
foreach(test_name IN ITEMS ${test_list} )
330+
if(BUILD_SHARED_LIBS)
331+
polymorphic_archive_test(test_dll_exported polymorphic_derived1)
332+
foreach(test_name IN ITEMS ${test_list} )
342333
target_link_libraries(${test_name} dll_polymorphic_derived2 dll_polymorphic_base serialization wserialization)
343-
endforeach()
334+
endforeach()
335+
endif()
344336

345337
polymorphic_archive_test(test_no_rtti polymorphic_base polymorphic_derived1 polymorphic_derived2)
346338
polymorphic_archive_test(test_exported polymorphic_base polymorphic_derived1 polymorphic_derived2)

build/Jamfile.v2

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ project boost/serialization
1212
<conditional>@include-spirit
1313
;
1414

15+
import ../../config/checks/config : requires ;
16+
1517
SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ;
1618
rule include-spirit ( properties * )
1719
{
@@ -88,7 +90,7 @@ SOURCES =
8890
codecvt_null
8991
;
9092

91-
SOURCES_HAS_STD_LOCALE =
93+
SOURCES_HAS_STD_WSTREAMBUF =
9294
xml_oarchive
9395
utf8_codecvt_facet
9496
;
@@ -107,49 +109,11 @@ WSOURCES =
107109
polymorphic_xml_woarchive
108110
;
109111

110-
rule has-config-flag ( flag : properties * )
111-
{
112-
if ( "<define>$(flag)" in $(properties) || "<define>$(flag)=1" in $(properties) )
113-
{
114-
return 1 ;
115-
}
116-
else
117-
{
118-
return ;
119-
}
120-
}
121-
122-
rule select-define-specific-sources ( properties * )
123-
{
124-
local result ;
125-
if ! [ has-config-flag BOOST_NO_STD_LOCALE : $(properties) ]
126-
{
127-
result += <source>$(SOURCES_HAS_STD_LOCALE).cpp ;
128-
}
129-
130-
#ECHO additional sources $(result) ;
131-
132-
return $(result) ;
133-
}
134-
135-
rule should-build-wserialization ( properties * )
136-
{
137-
local result ;
138-
if [ has-config-flag BOOST_NO_STD_LOCALE : $(properties) ]
139-
{
140-
result += <build>no ;
141-
}
142-
143-
#ECHO should build wserialization $(result) ;
144-
145-
return $(result) ;
146-
}
147-
148112
lib boost_serialization
149113
: ## sources ##
150114
$(SOURCES).cpp
151115
: ## requirements ##
152-
<conditional>@select-define-specific-sources
116+
[ check-target-builds ../../config/checks//std_wstreambuf : <source>../src/$(SOURCES_HAS_STD_WSTREAMBUF).cpp ]
153117
<toolset>msvc:<cxxflags>/Gy
154118
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
155119
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
@@ -165,7 +129,7 @@ lib boost_serialization
165129
lib boost_wserialization
166130
: $(WSOURCES).cpp boost_serialization
167131
:
168-
<conditional>@should-build-wserialization
132+
[ requires std_wstreambuf ]
169133
<toolset>msvc:<cxxflags>/Gy
170134
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
171135
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS

doc/acknowledgments.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ <h2 align="center">Acknowledgments</h2>
5353
<a href="http://www.boost.org/people/beman_dawes.html">Beman Dawes</a> who got the boost
5454
serialization ball rolling. It was one or both of these two that invented
5555
the much beloved <code>&amp;</code> syntax used to implement both save and
56-
load in one fuction specification.
56+
load in one function specification.
5757
<li><a href="http://www.boost.org/people/vladimir_prus.htm">Vladimir Prus</a> for evaluating an
5858
early draft and contributing the diamond inheritance example.
5959
<li><a href="http://www.boost.org/people/william_kempf.htm">William E. Kempf</a>

doc/archive_reference.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h3><a name="trivial">Trivial Archive</a></h3>
4141
Our discussion will focus on archives used for saving as the hierarchy is exactly analogous
4242
for archives used for loading data.
4343

44-
<h4>Minimum Requirments</h4>
44+
<h4>Minimum Requirements</h4>
4545

4646
The simplest class which will model the <a href="archives.html"><strong>Archive</strong></a> concept specifies the functions that a
4747
class will look like:
@@ -58,10 +58,10 @@ <h4>Minimum Requirments</h4>
5858
typedef boost::mpl::bool_&lt;true&gt; is_saving;
5959
typedef boost::mpl::bool_&lt;false&gt; is_loading;
6060
template&lt;class T&gt; void register_type(){}
61-
template&lt;class T&gt; trivial_oarchive & operator&lt;&lt;(const T & t){
61+
template&lt;class T&gt; trivial_oarchive &amp; operator&lt;&lt;(const T &amp; t){
6262
return *this;
6363
}
64-
template&lt;class T&gt; trivial_oarchive & operator&(const T & t){
64+
template&lt;class T&gt; trivial_oarchive &amp; operator&amp;(const T &amp; t){
6565
return *this &lt;&lt; t;
6666
}
6767
void save_binary(void *address, std::size_t count){};
@@ -172,10 +172,10 @@ <h4>Optional Overrides</h4>
172172
<p>
173173
<dt><h4><code>
174174
template&lt;class T&gt;
175-
void save_override(T & t, int);
175+
void save_override(T &amp; t, int);
176176
</code></h4></dt>
177177
<dd>
178-
<strong>Default</strong>:Invokes <code style="white-space: normal">archive::save(Archive & ar, t)</code><br>
178+
<strong>Default</strong>:Invokes <code style="white-space: normal">archive::save(Archive &amp; ar, t)</code><br>
179179
This is the main entry into the serialization library.<br>
180180
<strong>Purpose</strong>:This can be specialized in cases where the data is to be written
181181
to the archive in some special way. For example, XML archives implement special handling for
@@ -190,7 +190,7 @@ <h4>Types used by the serialization library</h4>
190190
The serialization library injects bookkeeping data into the serialization archive.
191191
This data includes things like object ids, version numbers, class names etc. Each
192192
of these objects is included in a wrapper so that the archive class can override the
193-
implementation of <code style="white-space: normal">void save_override(T & t, int);</code>.
193+
implementation of <code style="white-space: normal">void save_override(T &amp; t, int);</code>.
194194
For example, in the XML archive, the override for this type renders an object_id equal to 23 as
195195
"object_id=_23". The following table lists the types defined in the
196196
<code style="white-space: normal">boost::archive namespace</code>
@@ -250,7 +250,7 @@ <h3><a name="usage">Usage</a></h3>
250250
<ul>
251251
<li>Instances of a derived class are serialized through a base class pointer.
252252
<li>Such instances are not "registered" neither implicitly nor explicitly. That
253-
is, the macro <code style="white-space: normal">BOOT_CLASS_EXPORT</code> is used
253+
is, the macro <code style="white-space: normal">BOOST_CLASS_EXPORT</code> is used
254254
to instantiate the serialization code for the included archives.
255255
</ul>
256256

@@ -271,7 +271,7 @@ <h4><a name="testing">Testing</h4>
271271
Exhaustive testing of the library requires testing the different aspects of object
272272
serialization with each archive. There are 46 different tests that can run with any archive.
273273
There are 5 "standard archives" included with the system.
274-
(3 in systems that don't support wide charactor i/o).
274+
(3 in systems that don't support wide character i/o).
275275
<p>
276276
In addition, there are 28 other tests which aren't related to any particular archive class.
277277
<p>
@@ -323,7 +323,7 @@ <h4>Motivation</h4>
323323

324324
All archives described so far are implemented as templates. Code to save and load
325325
data to archives is regenerated for each combination of archive class and data type.
326-
Under these cirumstances, a good optimizing compiler that can expand
326+
Under these circumstances, a good optimizing compiler that can expand
327327
<code>inline</code> functions to enough depth will generate fast code.
328328
However:
329329
<ul>
@@ -400,15 +400,15 @@ <h4>Usage</h4>
400400
archive functions. This will result in a detectable degradation in performance for
401401
saving and loading archives.
402402
<p>
403-
Note that the concept of polymophic archives is fundamentally incompatible with the
403+
Note that the concept of polymorphic archives is fundamentally incompatible with the
404404
serialization of new types that are marked "primitive" by the user with:
405405
<pre><code>
406406
BOOST_CLASS_IMPLEMENTATION(my_primitive_type, boost::serialization::primitive_type)
407407
</code></pre>
408408

409409
Code to implement serialization for these types is instantiated "on the fly" in the user's program.
410410
But this conflicts with the whole purpose of the polymorphic archive. An attempt to
411-
serialize such a primitive type will result in a compilation error since the common polymorhic
411+
serialize such a primitive type will result in a compilation error since the common polymorphic
412412
interface is static and cannot instantiate code for a new type.
413413

414414
<p>

0 commit comments

Comments
 (0)