mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-19 08:46:41 +01:00
MSVC warning fixes in tests
- only use "#pragma GCC" on GCC-compatible compilers - suppress deprecation warnings also on MSVC
This commit is contained in:
parent
d61cddedac
commit
240c85a10c
@ -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 @@ int main(int argc, const char* argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
@ -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
|
||||
|
||||
#include "jsontest.h"
|
||||
#include <json/config.h>
|
||||
@ -2591,4 +2595,6 @@ int main(int argc, const char* argv[]) {
|
||||
return runner.runCommandLine(argc, argv);
|
||||
}
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user