WinCE Compatibility Fix

Note: str.imbue and std::locale::classic() are not supported on WINCE
This commit is contained in:
pffang 2014-07-10 10:19:01 +08:00 committed by Christopher Dunn
parent 8582876c5c
commit 27e3263894
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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