From 30480b177e39d4a62dac11f879fe32e35987f1e7 Mon Sep 17 00:00:00 2001 From: AraHaan Date: Mon, 6 Nov 2017 11:54:49 -0500 Subject: [PATCH 1/2] Fix Compile warning in Visual Studio --- src/json.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/json.hpp b/src/json.hpp index d28325a66..018c5f8e0 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -116,6 +116,21 @@ SOFTWARE. #elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) #define JSON_HAS_CPP_14 #endif +/* +In Visual Studio 2017 there are warnings on min +and max in this header having not enough args. +This is because in C min and max take args and +wll are not needed anyway so we undefine them +first to silence these annoying warnings!!! +*/ +#if (_MSC_VER >= 1911) +#ifdef min +#undef min +#endif +#ifdef max +#undef max +#endif +#endif /*! @brief namespace for Niels Lohmann From 260c1563bfb81a51a53d885f1dd3f3ec90856471 Mon Sep 17 00:00:00 2001 From: AraHaan Date: Mon, 6 Nov 2017 12:12:35 -0500 Subject: [PATCH 2/2] Update json.hpp --- src/json.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 018c5f8e0..4303265b9 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -120,17 +120,15 @@ SOFTWARE. In Visual Studio 2017 there are warnings on min and max in this header having not enough args. This is because in C min and max take args and -wll are not needed anyway so we undefine them +well are not needed anyway so we undefine them first to silence these annoying warnings!!! */ -#if (_MSC_VER >= 1911) #ifdef min #undef min #endif #ifdef max #undef max #endif -#endif /*! @brief namespace for Niels Lohmann