Skip to content

Commit

Permalink
Merge pull request #1502 from ylavic/compilation_fixes
Browse files Browse the repository at this point in the history
Compilation fixes
  • Loading branch information
miloyip committed Dec 3, 2019
2 parents eeb9d55 + 92f99bc commit dfbe1db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions example/sortkeys/sortkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ int main() {
// C++11 supports std::move() of Value so it always have no problem for std::sort().
// Some C++03 implementations of std::sort() requires copy constructor which causes compilation error.
// Needs a sorting function only depends on std::swap() instead.
#if __cplusplus >= 201103L || !defined(__GLIBCXX__)
#if __cplusplus >= 201103L || (!defined(__GLIBCXX__) && (!defined(_MSC_VER) || _MSC_VER >= 1900))
std::sort(d.MemberBegin(), d.MemberEnd(), NameComparator());
#endif

printIt(d);

Expand All @@ -59,4 +58,5 @@ int main() {
"zeta": false
}
*/
#endif
}
3 changes: 2 additions & 1 deletion include/rapidjson/rapidjson.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,8 @@ RAPIDJSON_NAMESPACE_END
#if RAPIDJSON_HAS_CXX11_NOEXCEPT
#define RAPIDJSON_NOEXCEPT_ASSERT(x)
#else
#define RAPIDJSON_NOEXCEPT_ASSERT(x) RAPIDJSON_ASSERT(x)
#include <cassert>
#define RAPIDJSON_NOEXCEPT_ASSERT(x) assert(x)
#endif // RAPIDJSON_HAS_CXX11_NOEXCEPT
#else
#define RAPIDJSON_NOEXCEPT_ASSERT(x) RAPIDJSON_ASSERT(x)
Expand Down
3 changes: 3 additions & 0 deletions test/unittest/unittest.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ class AssertException : public std::logic_error {

#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 {
Expand Down

0 comments on commit dfbe1db

Please sign in to comment.