diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 4cdb9a579..2fff7f8f4 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -781,7 +781,11 @@ std::string Reader::getLocationLineAndColumn(Location location) const { getLocationLineAndColumn(location, line, column); char buffer[18 + 16 + 16 + 1]; #if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) + #if defined(WINCE) + _snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); + #else sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column); + #endif #else snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); #endif diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index d770cfaf8..d20cf12ae 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -63,6 +63,11 @@ std::string valueToString(UInt value) { #endif // # if defined(JSON_HAS_INT64) std::string valueToString(double value) { +#if defined(WINCE) + char buffer[32]; + _snprintf(buffer, sizeof(buffer), "%.16g", value); + return buffer; +#else // We need not request the alternative representation // that always has a decimal point because JSON doesn't distingish the // concepts of reals and integers. @@ -72,6 +77,7 @@ std::string valueToString(double value) { str.precision(16); str << value; return str.str(); +#endif } std::string valueToString(bool value) { return value ? "true" : "false"; }