MSVC warning fixes in tests
- only use "#pragma GCC" on GCC-compatible compilers
- suppress deprecation warnings also on MSVC
diff --git a/src/jsontestrunner/main.cpp b/src/jsontestrunner/main.cpp
index d24d7cf..531f541 100644
--- a/src/jsontestrunner/main.cpp
+++ b/src/jsontestrunner/main.cpp
@@ -3,8 +3,12 @@
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
+#pragma warning(disable : 4996)
+#endif
/* This executable is used for testing parser/writer using real JSON files.
*/
@@ -14,10 +18,6 @@
#include <sstream>
#include <stdio.h>
-#if defined(_MSC_VER) && _MSC_VER >= 1310
-#pragma warning(disable : 4996) // disable fopen deprecation warning
-#endif
-
struct Options
{
JSONCPP_STRING path;
@@ -328,4 +328,6 @@
}
}
+#if defined(__GNUC__)
#pragma GCC diagnostic pop
+#endif