Skip to content

Commit 27e3263

Browse files
pffangcdunn2001
authored andcommitted
WinCE Compatibility Fix
Note: str.imbue and std::locale::classic() are not supported on WINCE
1 parent 8582876 commit 27e3263

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/lib_json/json_reader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,11 @@ std::string Reader::getLocationLineAndColumn(Location location) const {
781781
getLocationLineAndColumn(location, line, column);
782782
char buffer[18 + 16 + 16 + 1];
783783
#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__)
784+
#if defined(WINCE)
785+
_snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
786+
#else
784787
sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
788+
#endif
785789
#else
786790
snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
787791
#endif

src/lib_json/json_writer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ std::string valueToString(double value) {
7373
#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with
7474
// visual studio 2005 to
7575
// avoid warning.
76+
#if defined(WINCE)
77+
_snprintf(buffer, sizeof(buffer), "%.16g", value);
78+
#else
7679
sprintf_s(buffer, sizeof(buffer), "%.16g", value);
80+
#endif
7781
#else
7882
snprintf(buffer, sizeof(buffer), "%.16g", value);
7983
#endif

0 commit comments

Comments
 (0)