Skip to content

Commit 36da284

Browse files
author
Erik Froseth
committed
Bug#24947436 UPGRADE RAPIDJSON TO VERSION 1.1.0
Upgrade the rapidjson library to version 1.1.0. This version contains fixes that remove compiler warnings on newer versions of clang, plus several other enhancements and bugfixes. We previously had a modification in the library, where we could choose to handle "-0" as a double value in order to preserve the signedness. This was mainly used by GIS code. Now, we send a flag to the JSON parser telling us whether to parse ALL numbers as double or not. This effectively uses the RawNumber callback in rapidjson instead of the individual Int64/Double/Int... callbacks. We now use this functionality instead of modifying the library, so that all custom modifications can be removed. Change-Id: I784ad30bca474ba1872ebb4e2d5867c4e11b9dd2
1 parent d2d4b66 commit 36da284

File tree

118 files changed

+2012
-1160
lines changed

Some content is hidden

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

118 files changed

+2012
-1160
lines changed

extra/RAPIDJSON-README

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1616
----
1717

1818
The rapidjson library included in this directory is based on
19-
https://github.com/miloyip/rapidjson, upstream commit
20-
75d0e4ff652769309052bbbb3745da12a572af9a.
19+
https://github.com/miloyip/rapidjson, version 1.1.0.
2120

22-
There is one change made to the library:
23-
24-
1) Rapidjson-specific changes from bug#19504183 have been applied, so that
25-
negative zero is handled properly.
26-
27-
2) RAPIDJSON_DIAG_OFF(unused-parameter) is added to rapidjson.h to silence some
28-
compiler warnings.
21+
The folder lib/jsonchecker is removed so that we don't include any code licensed
22+
under the JSON License.

extra/rapidjson/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ Testing
2020
/googletest
2121
install_manifest.txt
2222
Doxyfile
23+
Doxyfile.zh-cn
2324
DartConfiguration.tcl
2425
*.nupkg

extra/rapidjson/.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "thirdparty/gtest"]
22
path = thirdparty/gtest
3-
url = https://chromium.googlesource.com/external/googletest.git
3+
url = https://github.com/google/googletest.git

extra/rapidjson/.travis.yml

Lines changed: 10 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1+
sudo: required
2+
dist: precise
3+
14
language: cpp
2-
sudo: false
35
cache:
46
- ccache
57

6-
addons:
7-
apt:
8-
packages: &default_packages
9-
- cmake
10-
- valgrind
11-
128
env:
13-
global:
9+
global:
1410
- USE_CCACHE=1
1511
- CCACHE_SLOPPINESS=pch_defines,time_macros
1612
- CCACHE_COMPRESS=1
@@ -20,108 +16,41 @@ global:
2016
- GITHUB_REPO='miloyip/rapidjson'
2117
- secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk="
2218

19+
before_install:
20+
- sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
21+
- sudo apt-get update -qq
22+
- sudo apt-get install -y cmake valgrind g++-multilib libc6-dbg:i386
23+
2324
matrix:
2425
include:
2526
# gcc
2627
- env: CONF=release ARCH=x86 CXX11=ON
2728
compiler: gcc
28-
addons:
29-
apt:
30-
packages:
31-
- *default_packages
32-
- g++-multilib
33-
- libc6-dbg:i386
3429
- env: CONF=release ARCH=x86_64 CXX11=ON
3530
compiler: gcc
3631
- env: CONF=debug ARCH=x86 CXX11=OFF
3732
compiler: gcc
38-
addons:
39-
apt:
40-
packages:
41-
- *default_packages
42-
- g++-multilib
43-
- libc6-dbg:i386
4433
- env: CONF=debug ARCH=x86_64 CXX11=OFF
4534
compiler: gcc
4635
# clang
4736
- env: CONF=debug ARCH=x86 CXX11=ON CCACHE_CPP2=yes
4837
compiler: clang
49-
addons:
50-
apt:
51-
sources:
52-
- llvm-toolchain-precise-3.7
53-
- ubuntu-toolchain-r-test
54-
packages:
55-
- *default_packages
56-
- g++-multilib
57-
- libc6-dbg:i386
58-
- clang-3.7
5938
- env: CONF=debug ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
6039
compiler: clang
61-
addons:
62-
apt:
63-
sources:
64-
- llvm-toolchain-precise-3.7
65-
- ubuntu-toolchain-r-test
66-
packages:
67-
- *default_packages
68-
- clang-3.7
6940
- env: CONF=debug ARCH=x86 CXX11=OFF CCACHE_CPP2=yes
7041
compiler: clang
71-
addons:
72-
apt:
73-
sources:
74-
- llvm-toolchain-precise-3.7
75-
- ubuntu-toolchain-r-test
76-
packages:
77-
- *default_packages
78-
- g++-multilib
79-
- libc6-dbg:i386
80-
- clang-3.7
8142
- env: CONF=debug ARCH=x86_64 CXX11=OFF CCACHE_CPP2=yes
8243
compiler: clang
83-
addons:
84-
apt:
85-
sources:
86-
- llvm-toolchain-precise-3.7
87-
- ubuntu-toolchain-r-test
88-
packages:
89-
- *default_packages
90-
- clang-3.7
9144
- env: CONF=release ARCH=x86 CXX11=ON CCACHE_CPP2=yes
9245
compiler: clang
93-
addons:
94-
apt:
95-
sources:
96-
- llvm-toolchain-precise-3.7
97-
- ubuntu-toolchain-r-test
98-
packages:
99-
- *default_packages
100-
- g++-multilib
101-
- libc6-dbg:i386
102-
- clang-3.7
10346
- env: CONF=release ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
10447
compiler: clang
105-
addons:
106-
apt:
107-
sources:
108-
- llvm-toolchain-precise-3.7
109-
- ubuntu-toolchain-r-test
110-
packages:
111-
- *default_packages
112-
- clang-3.7
11348
# coverage report
11449
- env: CONF=debug ARCH=x86 CXX11=ON GCOV_FLAGS='--coverage'
11550
compiler: gcc
11651
cache:
11752
- ccache
11853
- pip
119-
addons:
120-
apt:
121-
packages:
122-
- *default_packages
123-
- g++-multilib
124-
- libc6-dbg:i386
12554
after_success:
12655
- pip install --user cpp-coveralls
12756
- coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
@@ -130,12 +59,6 @@ matrix:
13059
cache:
13160
- ccache
13261
- pip
133-
addons:
134-
apt:
135-
packages:
136-
- *default_packages
137-
- g++-multilib
138-
- libc6-dbg:i386
13962
after_success:
14063
- pip install --user cpp-coveralls
14164
- coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
@@ -158,7 +81,7 @@ before_script:
15881
- mkdir build
15982

16083
script:
161-
- if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi
84+
- if [ "$CXX" = "clang++" ]; then export CXXFLAGS="-stdlib=libc++ ${CXXFLAGS}"; fi
16285
- >
16386
eval "ARCH_FLAGS=\${ARCH_FLAGS_${ARCH}}" ;
16487
(cd build && cmake

extra/rapidjson/CHANGELOG.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,83 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
66

7+
## 1.1.0 - 2016-08-25
8+
9+
### Added
10+
* Add GenericDocument ctor overload to specify JSON type (#369)
11+
* Add FAQ (#372, #373, #374, #376)
12+
* Add forward declaration header `fwd.h`
13+
* Add @PlatformIO Library Registry manifest file (#400)
14+
* Implement assignment operator for BigInteger (#404)
15+
* Add comments support (#443)
16+
* Adding coapp definition (#460)
17+
* documenttest.cpp: EXPECT_THROW when checking empty allocator (470)
18+
* GenericDocument: add implicit conversion to ParseResult (#480)
19+
* Use <wchar.h> with C++ linkage on Windows ARM (#485)
20+
* Detect little endian for Microsoft ARM targets
21+
* Check Nan/Inf when writing a double (#510)
22+
* Add JSON Schema Implementation (#522)
23+
* Add iostream wrapper (#530)
24+
* Add Jsonx example for converting JSON into JSONx (a XML format) (#531)
25+
* Add optional unresolvedTokenIndex parameter to Pointer::Get() (#532)
26+
* Add encoding validation option for Writer/PrettyWriter (#534)
27+
* Add Writer::SetMaxDecimalPlaces() (#536)
28+
* Support {0, } and {0, m} in Regex (#539)
29+
* Add Value::Get/SetFloat(), Value::IsLossLessFloat/Double() (#540)
30+
* Add stream position check to reader unit tests (#541)
31+
* Add Templated accessors and range-based for (#542)
32+
* Add (Pretty)Writer::RawValue() (#543)
33+
* Add Document::Parse(std::string), Document::Parse(const char*, size_t length) and related APIs. (#553)
34+
* Add move constructor for GenericSchemaDocument (#554)
35+
* Add VS2010 and VS2015 to AppVeyor CI (#555)
36+
* Add parse-by-parts example (#556, #562)
37+
* Support parse number as string (#564, #589)
38+
* Add kFormatSingleLineArray for PrettyWriter (#577)
39+
* Added optional support for trailing commas (#584)
40+
* Added filterkey and filterkeydom examples (#615)
41+
* Added npm docs (#639)
42+
* Allow options for writing and parsing NaN/Infinity (#641)
43+
* Add std::string overload to PrettyWriter::Key() when RAPIDJSON_HAS_STDSTRING is defined (#698)
44+
45+
### Fixed
46+
* Fix gcc/clang/vc warnings (#350, #394, #397, #444, #447, #473, #515, #582, #589, #595, #667)
47+
* Fix documentation (#482, #511, #550, #557, #614, #635, #660)
48+
* Fix emscripten alignment issue (#535)
49+
* Fix missing allocator to uses of AddMember in document (#365)
50+
* CMake will no longer complain that the minimum CMake version is not specified (#501)
51+
* Make it usable with old VC8 (VS2005) (#383)
52+
* Prohibit C++11 move from Document to Value (#391)
53+
* Try to fix incorrect 64-bit alignment (#419)
54+
* Check return of fwrite to avoid warn_unused_result build failures (#421)
55+
* Fix UB in GenericDocument::ParseStream (#426)
56+
* Keep Document value unchanged on parse error (#439)
57+
* Add missing return statement (#450)
58+
* Fix Document::Parse(const Ch*) for transcoding (#478)
59+
* encodings.h: fix typo in preprocessor condition (#495)
60+
* Custom Microsoft headers are necessary only for Visual Studio 2012 and lower (#559)
61+
* Fix memory leak for invalid regex (26e69ffde95ba4773ab06db6457b78f308716f4b)
62+
* Fix a bug in schema minimum/maximum keywords for 64-bit integer (e7149d665941068ccf8c565e77495521331cf390)
63+
* Fix a crash bug in regex (#605)
64+
* Fix schema "required" keyword cannot handle duplicated keys (#609)
65+
* Fix cmake CMP0054 warning (#612)
66+
* Added missing include guards in istreamwrapper.h and ostreamwrapper.h (#634)
67+
* Fix undefined behaviour (#646)
68+
* Fix buffer overrun using PutN (#673)
69+
* Fix rapidjson::value::Get<std::string>() may returns wrong data (#681)
70+
* Add Flush() for all value types (#689)
71+
* Handle malloc() fail in PoolAllocator (#691)
72+
* Fix builds on x32 platform. #703
73+
74+
### Changed
75+
* Clarify problematic JSON license (#392)
76+
* Move Travis to container based infrastructure (#504, #558)
77+
* Make whitespace array more compact (#513)
78+
* Optimize Writer::WriteString() with SIMD (#544)
79+
* x86-64 48-bit pointer optimization for GenericValue (#546)
80+
* Define RAPIDJSON_HAS_CXX11_RVALUE_REFS directly in clang (#617)
81+
* Make GenericSchemaDocument constructor explicit (#674)
82+
* Optimize FindMember when use std::string (#690)
83+
784
## [1.0.2] - 2015-05-14
885

986
### Added
@@ -12,6 +89,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1289
### Fixed
1390
* Include rapidjson.h for all internal/error headers.
1491
* Parsing some numbers incorrectly in full-precision mode (`kFullPrecisionParseFlag`) (#342)
92+
* Fix some numbers parsed incorrectly (#336)
1593
* Fix alignment of 64bit platforms (#328)
1694
* Fix MemoryPoolAllocator::Clear() to clear user-buffer (0691502573f1afd3341073dd24b12c3db20fbde4)
1795

@@ -73,7 +151,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
73151

74152
## 0.1 - 2011-11-18
75153

76-
[Unreleased]: https://github.com/miloyip/rapidjson/compare/v1.0.2...HEAD
154+
[Unreleased]: https://github.com/miloyip/rapidjson/compare/v1.1.0...HEAD
155+
[1.1.0]: https://github.com/miloyip/rapidjson/compare/v1.0.2...v1.1.0
77156
[1.0.2]: https://github.com/miloyip/rapidjson/compare/v1.0.1...v1.0.2
78157
[1.0.1]: https://github.com/miloyip/rapidjson/compare/v1.0.0...v1.0.1
79158
[1.0.0]: https://github.com/miloyip/rapidjson/compare/v1.0-beta...v1.0.0

extra/rapidjson/CMakeLists.txt

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2+
if(POLICY CMP0025)
3+
# detect Apple's Clang
4+
cmake_policy(SET CMP0025 NEW)
5+
endif()
6+
if(POLICY CMP0054)
7+
cmake_policy(SET CMP0054 NEW)
8+
endif()
9+
210
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
311

412
PROJECT(RapidJSON CXX)
513

614
set(LIB_MAJOR_VERSION "1")
7-
set(LIB_MINOR_VERSION "0")
8-
set(LIB_PATCH_VERSION "2")
15+
set(LIB_MINOR_VERSION "1")
16+
set(LIB_PATCH_VERSION "0")
917
set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}")
1018

1119
# compile in release with debug info mode by default
@@ -24,6 +32,9 @@ option(RAPIDJSON_BUILD_THIRDPARTY_GTEST
2432

2533
option(RAPIDJSON_BUILD_CXX11 "Build rapidjson with C++11 (gcc/clang)" ON)
2634

35+
option(RAPIDJSON_BUILD_ASAN "Build rapidjson with address sanitizer (gcc/clang)" OFF)
36+
option(RAPIDJSON_BUILD_UBSAN "Build rapidjson with undefined behavior sanitizer (gcc/clang)" OFF)
37+
2738
option(RAPIDJSON_HAS_STDSTRING "" OFF)
2839
if(RAPIDJSON_HAS_STDSTRING)
2940
add_definitions(-DRAPIDJSON_HAS_STDSTRING)
@@ -47,11 +58,35 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
4758
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
4859
endif()
4960
endif()
61+
if (RAPIDJSON_BUILD_ASAN)
62+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.0")
63+
message(FATAL_ERROR "GCC < 4.8 doesn't support the address sanitizer")
64+
else()
65+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
66+
endif()
67+
endif()
68+
if (RAPIDJSON_BUILD_UBSAN)
69+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9.0")
70+
message(FATAL_ERROR "GCC < 4.9 doesn't support the undefined behavior sanitizer")
71+
else()
72+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
73+
endif()
74+
endif()
5075
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5176
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror -Wno-missing-field-initializers")
5277
if (RAPIDJSON_BUILD_CXX11)
5378
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
5479
endif()
80+
if (RAPIDJSON_BUILD_ASAN)
81+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
82+
endif()
83+
if (RAPIDJSON_BUILD_UBSAN)
84+
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
85+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error")
86+
else()
87+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
88+
endif()
89+
endif()
5590
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
5691
add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
5792
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")

extra/rapidjson/CMakeModules/FindGTestSrc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
SET(GTEST_SEARCH_PATH
33
"${GTEST_SOURCE_DIR}"
4-
"${CMAKE_CURRENT_LIST_DIR}/../thirdparty/gtest")
4+
"${CMAKE_CURRENT_LIST_DIR}/../thirdparty/gtest/googletest")
55

66
IF(UNIX)
77
IF(RAPIDJSON_BUILD_THIRDPARTY_GTEST)

extra/rapidjson/appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
os: Visual Studio 2015 CTP
2-
version: 1.0.2.{build}
2+
version: 1.1.0.{build}
33

44
configuration:
55
- Debug

extra/rapidjson/bin/jsonchecker/fail1.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

extra/rapidjson/bin/jsonchecker/fail10.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

extra/rapidjson/bin/jsonchecker/fail11.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

extra/rapidjson/bin/jsonchecker/fail12.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

extra/rapidjson/bin/jsonchecker/fail13.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

extra/rapidjson/bin/jsonchecker/fail14.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

extra/rapidjson/bin/jsonchecker/fail15.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

extra/rapidjson/bin/jsonchecker/fail16.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

extra/rapidjson/bin/jsonchecker/fail17.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)