Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilo Yip <miloyip@gmail.com>2016-10-17 09:29:10 +0300
committerGitHub <noreply@github.com>2016-10-17 09:29:10 +0300
commit3b1a03749967637ce5c89d49f0c6b71fa4a3182a (patch)
tree280d0a6a849450034c199d45c29de5bced653b2f /include/rapidjson/document.h
parent236322797475807ae52502453a51d6640104bc83 (diff)
parent51a31ce006f7dfb850771688fe6a2ccdfcf765af (diff)
Merge pull request #748 from sfinktah/sfinktah-minwindef-fix
Fix for winmindef.h defining min/max macros
Diffstat (limited to 'include/rapidjson/document.h')
-rw-r--r--include/rapidjson/document.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
index f4dd25c4..703c0611 100644
--- a/include/rapidjson/document.h
+++ b/include/rapidjson/document.h
@@ -29,6 +29,14 @@ RAPIDJSON_DIAG_PUSH
#ifdef _MSC_VER
RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
RAPIDJSON_DIAG_OFF(4244) // conversion from kXxxFlags to 'uint16_t', possible loss of data
+#ifdef _MINWINDEF_ // see: http://stackoverflow.com/questions/22744262/cant-call-stdmax-because-minwindef-h-defines-max
+#ifndef NOMINMAX
+#pragma push_macro("min")
+#pragma push_macro("max")
+#undef min
+#undef max
+#endif
+#endif
#endif
#ifdef __clang__
@@ -2573,6 +2581,12 @@ private:
};
RAPIDJSON_NAMESPACE_END
+#ifdef _MINWINDEF_ // see: http://stackoverflow.com/questions/22744262/cant-call-stdmax-because-minwindef-h-defines-max
+#ifndef NOMINMAX
+#pragma pop_macro("min")
+#pragma pop_macro("max")
+#endif
+#endif
RAPIDJSON_DIAG_POP
#endif // RAPIDJSON_DOCUMENT_H_