| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
#ifndef CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ |
| 16 |
#define CEREAL_RAPIDJSON_CEREAL_RAPIDJSON_H_ |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
#include <cstdlib> |
| 40 |
#include <cstring> |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
#define CEREAL_RAPIDJSON_STRINGIFY(x) CEREAL_RAPIDJSON_DO_STRINGIFY(x) |
| 51 |
#define CEREAL_RAPIDJSON_DO_STRINGIFY(x) #x |
| 52 |
|
| 53 |
|
| 54 |
#define CEREAL_RAPIDJSON_JOIN(X, Y) CEREAL_RAPIDJSON_DO_JOIN(X, Y) |
| 55 |
#define CEREAL_RAPIDJSON_DO_JOIN(X, Y) CEREAL_RAPIDJSON_DO_JOIN2(X, Y) |
| 56 |
#define CEREAL_RAPIDJSON_DO_JOIN2(X, Y) X##Y |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
#define CEREAL_RAPIDJSON_MAJOR_VERSION 1 |
| 76 |
#define CEREAL_RAPIDJSON_MINOR_VERSION 1 |
| 77 |
#define CEREAL_RAPIDJSON_PATCH_VERSION 0 |
| 78 |
#define CEREAL_RAPIDJSON_VERSION_STRING \ |
| 79 |
CEREAL_RAPIDJSON_STRINGIFY(CEREAL_RAPIDJSON_MAJOR_VERSION.CEREAL_RAPIDJSON_MINOR_VERSION.CEREAL_RAPIDJSON_PATCH_VERSION) |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
#ifndef CEREAL_RAPIDJSON_NAMESPACE |
| 118 |
#define CEREAL_RAPIDJSON_NAMESPACE rapidjson |
| 119 |
#endif |
| 120 |
#ifndef CEREAL_RAPIDJSON_NAMESPACE_BEGIN |
| 121 |
#define CEREAL_RAPIDJSON_NAMESPACE_BEGIN namespace CEREAL_RAPIDJSON_NAMESPACE { |
| 122 |
#endif |
| 123 |
#ifndef CEREAL_RAPIDJSON_NAMESPACE_END |
| 124 |
#define CEREAL_RAPIDJSON_NAMESPACE_END } |
| 125 |
#endif |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
#ifndef CEREAL_RAPIDJSON_HAS_STDSTRING |
| 131 |
#ifdef CEREAL_RAPIDJSON_DOXYGEN_RUNNING |
| 132 |
#define CEREAL_RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation |
| 133 |
#else |
| 134 |
#define CEREAL_RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default |
| 135 |
#endif |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
#endif |
| 147 |
|
| 148 |
#if CEREAL_RAPIDJSON_HAS_STDSTRING |
| 149 |
#include <string> |
| 150 |
#endif |
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
#ifndef CEREAL_RAPIDJSON_NO_INT64DEFINE |
| 166 |
|
| 167 |
#if defined(_MSC_VER) && (_MSC_VER < 1800) |
| 168 |
#include "msinttypes/stdint.h" |
| 169 |
#include "msinttypes/inttypes.h" |
| 170 |
#else |
| 171 |
|
| 172 |
#include <stdint.h> |
| 173 |
#include <inttypes.h> |
| 174 |
#endif |
| 175 |
|
| 176 |
#ifdef CEREAL_RAPIDJSON_DOXYGEN_RUNNING |
| 177 |
#define CEREAL_RAPIDJSON_NO_INT64DEFINE |
| 178 |
#endif |
| 179 |
#endif |
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
#ifndef CEREAL_RAPIDJSON_FORCEINLINE |
| 185 |
|
| 186 |
#if defined(_MSC_VER) && defined(NDEBUG) |
| 187 |
#define CEREAL_RAPIDJSON_FORCEINLINE __forceinline |
| 188 |
#elif defined(__GNUC__) && __GNUC__ >= 4 && defined(NDEBUG) |
| 189 |
#define CEREAL_RAPIDJSON_FORCEINLINE __attribute__((always_inline)) |
| 190 |
#else |
| 191 |
#define CEREAL_RAPIDJSON_FORCEINLINE |
| 192 |
#endif |
| 193 |
|
| 194 |
#endif |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
#define CEREAL_RAPIDJSON_LITTLEENDIAN 0 //!< Little endian machine |
| 199 |
#define CEREAL_RAPIDJSON_BIGENDIAN 1 //!< Big endian machine |
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
#ifndef CEREAL_RAPIDJSON_ENDIAN |
| 215 |
|
| 216 |
# ifdef __BYTE_ORDER__ |
| 217 |
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ |
| 218 |
# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN |
| 219 |
# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ |
| 220 |
# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN |
| 221 |
# else |
| 222 |
# error Unknown machine endianness detected. User needs to define CEREAL_RAPIDJSON_ENDIAN. |
| 223 |
# endif |
| 224 |
|
| 225 |
# elif defined(__GLIBC__) |
| 226 |
# include <endian.h> |
| 227 |
# if (__BYTE_ORDER == __LITTLE_ENDIAN) |
| 228 |
# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN |
| 229 |
# elif (__BYTE_ORDER == __BIG_ENDIAN) |
| 230 |
# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN |
| 231 |
# else |
| 232 |
# error Unknown machine endianness detected. User needs to define CEREAL_RAPIDJSON_ENDIAN. |
| 233 |
# endif |
| 234 |
|
| 235 |
# elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) |
| 236 |
# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN |
| 237 |
# elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) |
| 238 |
# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN |
| 239 |
|
| 240 |
# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) |
| 241 |
# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_BIGENDIAN |
| 242 |
# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) |
| 243 |
# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN |
| 244 |
# elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) |
| 245 |
# define CEREAL_RAPIDJSON_ENDIAN CEREAL_RAPIDJSON_LITTLEENDIAN |
| 246 |
# elif defined(CEREAL_RAPIDJSON_DOXYGEN_RUNNING) |
| 247 |
# define CEREAL_RAPIDJSON_ENDIAN |
| 248 |
# else |
| 249 |
# error Unknown machine endianness detected. User needs to define CEREAL_RAPIDJSON_ENDIAN. |
| 250 |
# endif |
| 251 |
#endif |
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
#ifndef CEREAL_RAPIDJSON_64BIT |
| 258 |
#if defined(__LP64__) || (defined(__x86_64__) && defined(__ILP32__)) || defined(_WIN64) || defined(__EMSCRIPTEN__) |
| 259 |
#define CEREAL_RAPIDJSON_64BIT 1 |
| 260 |
#else |
| 261 |
#define CEREAL_RAPIDJSON_64BIT 0 |
| 262 |
#endif |
| 263 |
#endif |
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
#ifndef CEREAL_RAPIDJSON_ALIGN |
| 276 |
#define CEREAL_RAPIDJSON_ALIGN(x) (((x) + static_cast<size_t>(7u)) & ~static_cast<size_t>(7u)) |
| 277 |
#endif |
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
#ifndef CEREAL_RAPIDJSON_UINT64_C2 |
| 289 |
#define CEREAL_RAPIDJSON_UINT64_C2(high32, low32) ((static_cast<uint64_t>(high32) << 32) | static_cast<uint64_t>(low32)) |
| 290 |
#endif |
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
#ifndef CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION |
| 304 |
#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) |
| 305 |
#define CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION 1 |
| 306 |
#else |
| 307 |
#define CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION 0 |
| 308 |
#endif |
| 309 |
#endif |
| 310 |
|
| 311 |
#if CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION == 1 |
| 312 |
#if CEREAL_RAPIDJSON_64BIT != 1 |
| 313 |
#error CEREAL_RAPIDJSON_48BITPOINTER_OPTIMIZATION can only be set to 1 when CEREAL_RAPIDJSON_64BIT=1 |
| 314 |
#endif |
| 315 |
#define CEREAL_RAPIDJSON_SETPOINTER(type, p, x) (p = reinterpret_cast<type *>((reinterpret_cast<uintptr_t>(p) & static_cast<uintptr_t>(CEREAL_RAPIDJSON_UINT64_C2(0xFFFF0000, 0x00000000))) | reinterpret_cast<uintptr_t>(reinterpret_cast<const void*>(x)))) |
| 316 |
#define CEREAL_RAPIDJSON_GETPOINTER(type, p) (reinterpret_cast<type *>(reinterpret_cast<uintptr_t>(p) & static_cast<uintptr_t>(CEREAL_RAPIDJSON_UINT64_C2(0x0000FFFF, 0xFFFFFFFF)))) |
| 317 |
#else |
| 318 |
#define CEREAL_RAPIDJSON_SETPOINTER(type, p, x) (p = (x)) |
| 319 |
#define CEREAL_RAPIDJSON_GETPOINTER(type, p) (p) |
| 320 |
#endif |
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
#if defined(CEREAL_RAPIDJSON_SSE2) || defined(CEREAL_RAPIDJSON_SSE42) \ |
| 352 |
|| defined(CEREAL_RAPIDJSON_NEON) || defined(CEREAL_RAPIDJSON_DOXYGEN_RUNNING) |
| 353 |
#define CEREAL_RAPIDJSON_SIMD |
| 354 |
#endif |
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
#ifndef CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE |
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
#ifdef CEREAL_RAPIDJSON_DOXYGEN_RUNNING |
| 376 |
#define CEREAL_RAPIDJSON_NO_SIZETYPEDEFINE |
| 377 |
#endif |
| 378 |
CEREAL_RAPIDJSON_NAMESPACE_BEGIN |
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
typedef unsigned SizeType; |
| 385 |
CEREAL_RAPIDJSON_NAMESPACE_END |
| 386 |
#endif |
| 387 |
|
| 388 |
|
| 389 |
CEREAL_RAPIDJSON_NAMESPACE_BEGIN |
| 390 |
using std::size_t; |
| 391 |
CEREAL_RAPIDJSON_NAMESPACE_END |
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
#ifndef CEREAL_RAPIDJSON_ASSERT |
| 405 |
#include <cassert> |
| 406 |
#define CEREAL_RAPIDJSON_ASSERT(x) assert(x) |
| 407 |
#endif |
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
#ifndef CEREAL_RAPIDJSON_STATIC_ASSERT |
| 414 |
#if __cplusplus >= 201103L || ( defined(_MSC_VER) && _MSC_VER >= 1800 ) |
| 415 |
#define CEREAL_RAPIDJSON_STATIC_ASSERT(x) \ |
| 416 |
static_assert(x, CEREAL_RAPIDJSON_STRINGIFY(x)) |
| 417 |
#endif |
| 418 |
#endif |
| 419 |
|
| 420 |
|
| 421 |
#ifndef CEREAL_RAPIDJSON_STATIC_ASSERT |
| 422 |
#ifndef __clang__ |
| 423 |
|
| 424 |
#endif |
| 425 |
CEREAL_RAPIDJSON_NAMESPACE_BEGIN |
| 426 |
template <bool x> struct STATIC_ASSERTION_FAILURE; |
| 427 |
template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; }; |
| 428 |
template <size_t x> struct StaticAssertTest {}; |
| 429 |
CEREAL_RAPIDJSON_NAMESPACE_END |
| 430 |
|
| 431 |
#if defined(__GNUC__) || defined(__clang__) |
| 432 |
#define CEREAL_RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused)) |
| 433 |
#else |
| 434 |
#define CEREAL_RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE |
| 435 |
#endif |
| 436 |
#ifndef __clang__ |
| 437 |
|
| 438 |
#endif |
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
#define CEREAL_RAPIDJSON_STATIC_ASSERT(x) \ |
| 446 |
typedef ::CEREAL_RAPIDJSON_NAMESPACE::StaticAssertTest< \ |
| 447 |
sizeof(::CEREAL_RAPIDJSON_NAMESPACE::STATIC_ASSERTION_FAILURE<bool(x) >)> \ |
| 448 |
CEREAL_RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) CEREAL_RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE |
| 449 |
#endif |
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
#ifndef CEREAL_RAPIDJSON_LIKELY |
| 460 |
#if defined(__GNUC__) || defined(__clang__) |
| 461 |
#define CEREAL_RAPIDJSON_LIKELY(x) __builtin_expect(!!(x), 1) |
| 462 |
#else |
| 463 |
#define CEREAL_RAPIDJSON_LIKELY(x) (x) |
| 464 |
#endif |
| 465 |
#endif |
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
#ifndef CEREAL_RAPIDJSON_UNLIKELY |
| 473 |
#if defined(__GNUC__) || defined(__clang__) |
| 474 |
#define CEREAL_RAPIDJSON_UNLIKELY(x) __builtin_expect(!!(x), 0) |
| 475 |
#else |
| 476 |
#define CEREAL_RAPIDJSON_UNLIKELY(x) (x) |
| 477 |
#endif |
| 478 |
#endif |
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
#define CEREAL_RAPIDJSON_MULTILINEMACRO_BEGIN do { |
| 486 |
#define CEREAL_RAPIDJSON_MULTILINEMACRO_END \ |
| 487 |
} while((void)0, 0) |
| 488 |
|
| 489 |
|
| 490 |
#define CEREAL_RAPIDJSON_VERSION_CODE(x,y,z) \ |
| 491 |
(((x)*100000) + ((y)*100) + (z)) |
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
#if defined(__GNUC__) |
| 497 |
#define CEREAL_RAPIDJSON_GNUC \ |
| 498 |
CEREAL_RAPIDJSON_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) |
| 499 |
#endif |
| 500 |
|
| 501 |
#if defined(__clang__) || (defined(CEREAL_RAPIDJSON_GNUC) && CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,2,0)) |
| 502 |
|
| 503 |
#define CEREAL_RAPIDJSON_PRAGMA(x) _Pragma(CEREAL_RAPIDJSON_STRINGIFY(x)) |
| 504 |
#define CEREAL_RAPIDJSON_DIAG_PRAGMA(x) CEREAL_RAPIDJSON_PRAGMA(GCC diagnostic x) |
| 505 |
#define CEREAL_RAPIDJSON_DIAG_OFF(x) \ |
| 506 |
CEREAL_RAPIDJSON_DIAG_PRAGMA(ignored CEREAL_RAPIDJSON_STRINGIFY(CEREAL_RAPIDJSON_JOIN(-W,x))) |
| 507 |
|
| 508 |
|
| 509 |
#if defined(__clang__) || (defined(CEREAL_RAPIDJSON_GNUC) && CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,6,0)) |
| 510 |
#define CEREAL_RAPIDJSON_DIAG_PUSH CEREAL_RAPIDJSON_DIAG_PRAGMA(push) |
| 511 |
#define CEREAL_RAPIDJSON_DIAG_POP CEREAL_RAPIDJSON_DIAG_PRAGMA(pop) |
| 512 |
#else |
| 513 |
#define CEREAL_RAPIDJSON_DIAG_PUSH |
| 514 |
#define CEREAL_RAPIDJSON_DIAG_POP |
| 515 |
#endif |
| 516 |
|
| 517 |
#elif defined(_MSC_VER) |
| 518 |
|
| 519 |
|
| 520 |
#define CEREAL_RAPIDJSON_PRAGMA(x) __pragma(x) |
| 521 |
#define CEREAL_RAPIDJSON_DIAG_PRAGMA(x) CEREAL_RAPIDJSON_PRAGMA(warning(x)) |
| 522 |
|
| 523 |
#define CEREAL_RAPIDJSON_DIAG_OFF(x) CEREAL_RAPIDJSON_DIAG_PRAGMA(disable: x) |
| 524 |
#define CEREAL_RAPIDJSON_DIAG_PUSH CEREAL_RAPIDJSON_DIAG_PRAGMA(push) |
| 525 |
#define CEREAL_RAPIDJSON_DIAG_POP CEREAL_RAPIDJSON_DIAG_PRAGMA(pop) |
| 526 |
|
| 527 |
#else |
| 528 |
|
| 529 |
#define CEREAL_RAPIDJSON_DIAG_OFF(x) |
| 530 |
#define CEREAL_RAPIDJSON_DIAG_PUSH |
| 531 |
#define CEREAL_RAPIDJSON_DIAG_POP |
| 532 |
|
| 533 |
#endif |
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
|
| 538 |
#ifndef CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS |
| 539 |
#if defined(__clang__) |
| 540 |
#if __has_feature(cxx_rvalue_references) && \ |
| 541 |
(defined(_MSC_VER) || defined(_LIBCPP_VERSION) || defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306) |
| 542 |
#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 |
| 543 |
#else |
| 544 |
#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 |
| 545 |
#endif |
| 546 |
#elif (defined(CEREAL_RAPIDJSON_GNUC) && (CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ |
| 547 |
(defined(_MSC_VER) && _MSC_VER >= 1600) || \ |
| 548 |
(defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) |
| 549 |
|
| 550 |
#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 |
| 551 |
#else |
| 552 |
#define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 |
| 553 |
#endif |
| 554 |
#endif |
| 555 |
|
| 556 |
#ifndef CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT |
| 557 |
#if defined(__clang__) |
| 558 |
#define CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept) |
| 559 |
#elif (defined(CEREAL_RAPIDJSON_GNUC) && (CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ |
| 560 |
(defined(_MSC_VER) && _MSC_VER >= 1900) || \ |
| 561 |
(defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) |
| 562 |
#define CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT 1 |
| 563 |
#else |
| 564 |
#define CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT 0 |
| 565 |
#endif |
| 566 |
#endif |
| 567 |
#if CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT |
| 568 |
#define CEREAL_RAPIDJSON_NOEXCEPT noexcept |
| 569 |
#else |
| 570 |
#define CEREAL_RAPIDJSON_NOEXCEPT |
| 571 |
#endif |
| 572 |
|
| 573 |
|
| 574 |
#ifndef CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS |
| 575 |
#if (defined(_MSC_VER) && _MSC_VER >= 1700) |
| 576 |
#define CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS 1 |
| 577 |
#else |
| 578 |
#define CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS 0 |
| 579 |
#endif |
| 580 |
#endif |
| 581 |
|
| 582 |
#ifndef CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR |
| 583 |
#if defined(__clang__) |
| 584 |
#define CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for) |
| 585 |
#elif (defined(CEREAL_RAPIDJSON_GNUC) && (CEREAL_RAPIDJSON_GNUC >= CEREAL_RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ |
| 586 |
(defined(_MSC_VER) && _MSC_VER >= 1700) || \ |
| 587 |
(defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) |
| 588 |
#define CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR 1 |
| 589 |
#else |
| 590 |
#define CEREAL_RAPIDJSON_HAS_CXX11_RANGE_FOR 0 |
| 591 |
#endif |
| 592 |
#endif |
| 593 |
|
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
|
| 599 |
|
| 600 |
|
| 601 |
|
| 602 |
|
| 603 |
|
| 604 |
|
| 605 |
|
| 606 |
|
| 607 |
|
| 608 |
|
| 609 |
|
| 610 |
#ifndef CEREAL_RAPIDJSON_NOEXCEPT_ASSERT |
| 611 |
#ifdef CEREAL_RAPIDJSON_ASSERT_THROWS |
| 612 |
#if CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT |
| 613 |
#define CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(x) |
| 614 |
#else |
| 615 |
#define CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(x) CEREAL_RAPIDJSON_ASSERT(x) |
| 616 |
#endif |
| 617 |
#else |
| 618 |
#define CEREAL_RAPIDJSON_NOEXCEPT_ASSERT(x) CEREAL_RAPIDJSON_ASSERT(x) |
| 619 |
#endif |
| 620 |
#endif |
| 621 |
|
| 622 |
|
| 623 |
|
| 624 |
|
| 625 |
#ifndef CEREAL_RAPIDJSON_NEW |
| 626 |
|
| 627 |
#define CEREAL_RAPIDJSON_NEW(TypeName) new TypeName |
| 628 |
#endif |
| 629 |
#ifndef CEREAL_RAPIDJSON_DELETE |
| 630 |
|
| 631 |
#define CEREAL_RAPIDJSON_DELETE(x) delete x |
| 632 |
#endif |
| 633 |
|
| 634 |
|
| 635 |
|
| 636 |
|
| 637 |
|
| 638 |
|
| 639 |
|
| 640 |
|
| 641 |
CEREAL_RAPIDJSON_NAMESPACE_BEGIN |
| 642 |
|
| 643 |
|
| 644 |
enum Type { |
| 645 |
kNullType = 0, |
| 646 |
kFalseType = 1, |
| 647 |
kTrueType = 2, |
| 648 |
kObjectType = 3, |
| 649 |
kArrayType = 4, |
| 650 |
kStringType = 5, |
| 651 |
kNumberType = 6 |
| 652 |
}; |
| 653 |
|
| 654 |
CEREAL_RAPIDJSON_NAMESPACE_END |
| 655 |
|
| 656 |
#endif |