diff options
Diffstat (limited to '3rdparty/rapidjson/test/unittest/unittest.h')
-rw-r--r-- | 3rdparty/rapidjson/test/unittest/unittest.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/3rdparty/rapidjson/test/unittest/unittest.h b/3rdparty/rapidjson/test/unittest/unittest.h index e125bf88dc3..0e64d3970b7 100644 --- a/3rdparty/rapidjson/test/unittest/unittest.h +++ b/3rdparty/rapidjson/test/unittest/unittest.h @@ -1,6 +1,6 @@ // Tencent is pleased to support the open source community by making RapidJSON available. // -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. // // Licensed under the MIT License (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy of the License at @@ -78,7 +78,7 @@ inline Ch* StrDup(const Ch* str) { } inline FILE* TempFile(char *filename) { -#ifdef _MSC_VER +#if defined(__WIN32__) || defined(_MSC_VER) filename = tmpnam(filename); // For Visual Studio, tmpnam() adds a backslash in front. Remove it. @@ -117,7 +117,15 @@ public: #pragma GCC diagnostic pop #endif -#define RAPIDJSON_ASSERT(x) if (!(x)) throw AssertException(RAPIDJSON_STRINGIFY(x)) +// Not using noexcept for testing RAPIDJSON_ASSERT() +#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0 + +#ifndef RAPIDJSON_ASSERT +#define RAPIDJSON_ASSERT(x) (!(x) ? throw AssertException(RAPIDJSON_STRINGIFY(x)) : (void)0u) +#ifndef RAPIDJSON_ASSERT_THROWS +#define RAPIDJSON_ASSERT_THROWS +#endif +#endif class Random { public: |