Merge pull request #1502 from ylavic/compilation_fixes

Compilation fixes
diff --git a/example/sortkeys/sortkeys.cpp b/example/sortkeys/sortkeys.cpp
index c473784..7ede9fb 100644
--- a/example/sortkeys/sortkeys.cpp
+++ b/example/sortkeys/sortkeys.cpp
@@ -45,9 +45,8 @@
 // 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);
 
@@ -59,4 +58,5 @@
   "zeta": false
 }
 */
+#endif
 }
diff --git a/include/rapidjson/rapidjson.h b/include/rapidjson/rapidjson.h
index b71ea79..329ce92 100644
--- a/include/rapidjson/rapidjson.h
+++ b/include/rapidjson/rapidjson.h
@@ -631,7 +631,8 @@
 #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)
diff --git a/test/unittest/unittest.h b/test/unittest/unittest.h
index 84c1b73..0afac09 100644
--- a/test/unittest/unittest.h
+++ b/test/unittest/unittest.h
@@ -122,6 +122,9 @@
 
 #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 {