Skip to content

Commit

Permalink
WinCE Compatibility Fix
Browse files Browse the repository at this point in the history
Note: str.imbue and std::locale::classic() are not supported on WINCE
  • Loading branch information
pffang authored and cdunn2001 committed Jul 11, 2014
1 parent 8582876 commit 27e3263
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib_json/json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/lib_json/json_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ std::string valueToString(double value) {
#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with
// visual studio 2005 to
// avoid warning.
#if defined(WINCE)
_snprintf(buffer, sizeof(buffer), "%.16g", value);
#else
sprintf_s(buffer, sizeof(buffer), "%.16g", value);
#endif
#else
snprintf(buffer, sizeof(buffer), "%.16g", value);
#endif
Expand Down

0 comments on commit 27e3263

Please sign in to comment.