From e375b8c89e708780ceb76a2392a1dc3ee71e45c4 Mon Sep 17 00:00:00 2001 From: Anton Indrawan Date: Fri, 2 Oct 2015 17:49:02 +0200 Subject: [PATCH] Compiles jsoncpp with QNX 6.6 --- src/lib_json/json_reader.cpp | 6 +++++- src/lib_json/json_writer.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index c98b000..d2d6996 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -27,12 +27,16 @@ #else #define snprintf _snprintf #endif -#elif defined(__ANDROID__) +#elif defined(__ANDROID__) || defined(__QNXNTO__) #define snprintf snprintf #elif __cplusplus >= 201103L #define snprintf std::snprintf #endif +#if defined(__QNXNTO__) +#define sscanf std::sscanf +#endif + #if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 // Disable warning about strdup being deprecated. #pragma warning(disable : 4996) diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 1975189..38dd784 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -41,18 +41,20 @@ #endif #else #include +#if !(defined(__QNXNTO__)) // QNX already defines isfinite #define isfinite std::isfinite #endif +#endif #if defined(_MSC_VER) -#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above +#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above #define snprintf sprintf_s #elif _MSC_VER >= 1900 // VC++ 14.0 and above #define snprintf std::snprintf #else #define snprintf _snprintf #endif -#elif defined(__ANDROID__) +#elif defined(__ANDROID__) || defined(__QNXNTO__) #define snprintf snprintf #elif __cplusplus >= 201103L #define snprintf std::snprintf