Index: ext/libicpf/src/libicpf/exception.h =================================================================== diff -u -N -rb337c059691a6940b52a86388ff427c734be8eb6 -r2bf2aade8bcebd0a093ddc05e7687edbb5855adb --- ext/libicpf/src/libicpf/exception.h (.../exception.h) (revision b337c059691a6940b52a86388ff427c734be8eb6) +++ ext/libicpf/src/libicpf/exception.h (.../exception.h) (revision 2bf2aade8bcebd0a093ddc05e7687edbb5855adb) @@ -41,9 +41,9 @@ */ #define THROW(desc,app_code,sys_code,reserved_code) throw icpf::exception(desc, _t(__FILE__), _t(__FUNCTION__), __LINE__, app_code, sys_code, reserved_code) /// Logs an exception in a log file -#define LOG_EXCEPTION(except, ptr_log) (except)->log("Caught an exception in ", _t(__FUNCTION__), ptr_log) +#define LOG_EXCEPTION(except, ptr_log) (except)->log(_t("Caught an exception in "), _t(__FUNCTION__), ptr_log) /// Logs an unknown exception in a log file -#define LOG_UEXCEPTION(ptr_log) (ptr_log)->loge("Caught an unknown exception in " TSTRFMT, _t(__FUNCTION__)) +#define LOG_UEXCEPTION(ptr_log) (ptr_log)->loge(_t("Caught an unknown exception in ") TSTRFMT, _t(__FUNCTION__)) BEGIN_ICPF_NAMESPACE Index: ext/libicpf/src/libicpf/gen_types.h =================================================================== diff -u -N -rb337c059691a6940b52a86388ff427c734be8eb6 -r2bf2aade8bcebd0a093ddc05e7687edbb5855adb --- ext/libicpf/src/libicpf/gen_types.h (.../gen_types.h) (revision b337c059691a6940b52a86388ff427c734be8eb6) +++ ext/libicpf/src/libicpf/gen_types.h (.../gen_types.h) (revision 2bf2aade8bcebd0a093ddc05e7687edbb5855adb) @@ -302,18 +302,31 @@ // So, basically, those macros should be modified in some way - either by making // a dependence on _UNICODE define or by creating additional set of macros to be used // with wprintf() and use the current ones for printf(). - -/// Printf-style format string for displaying ansi strings (char_t based strings) -#define STRFMT _t("%s") -/// Printf-style format string for displaying ascii char -#define CHRFMT _t("%c") - #if defined(_WIN32) || defined(_WIN64) - /// Printf-style format string for displaying wide strings (wchar_t based strings) - #define WSTRFMT _t("%S") - /// Printf-style format string for displaying wide char - #define WCHRFMT _t("%C") + #ifdef _UNICODE + /// Printf-style format string for displaying ansi strings (char_t based strings) + #define STRFMT _t("%S") + /// Printf-style format string for displaying ascii char + #define CHRFMT _t("%C") + /// Printf-style format string for displaying wide strings (wchar_t based strings) + #define WSTRFMT _t("%s") + /// Printf-style format string for displaying wide char + #define WCHRFMT _t("%c") + #else + /// Printf-style format string for displaying ansi strings (char_t based strings) + #define STRFMT _t("%s") + /// Printf-style format string for displaying ascii char + #define CHRFMT _t("%c") + /// Printf-style format string for displaying wide strings (wchar_t based strings) + #define WSTRFMT _t("%S") + /// Printf-style format string for displaying wide char + #define WCHRFMT _t("%C") + #endif #else + /// Printf-style format string for displaying ansi strings (char_t based strings) + #define STRFMT _t("%s") + /// Printf-style format string for displaying ascii char + #define CHRFMT _t("%c") /// Printf-style format string for displaying wide strings (wchar_t based strings) #define WSTRFMT _t("%ls") /// Printf-style format string for displaying wide char (WARNING: untested) Index: ext/libicpf/src/libicpf/str_help.cpp =================================================================== diff -u -N -r21847bff9bc6958b98f3fe8bac319590b790fc0f -r2bf2aade8bcebd0a093ddc05e7687edbb5855adb --- ext/libicpf/src/libicpf/str_help.cpp (.../str_help.cpp) (revision 21847bff9bc6958b98f3fe8bac319590b790fc0f) +++ ext/libicpf/src/libicpf/str_help.cpp (.../str_help.cpp) (revision 2bf2aade8bcebd0a093ddc05e7687edbb5855adb) @@ -28,7 +28,7 @@ * \param[in] ch - character to check * \return True if the character is a whitespace one, false otherwise. */ -bool string_tool::is_whitespace(char_t ch) +bool string_tool::is_whitespace(tchar_t ch) { return ((ch >= 0x09) && (ch <= 0x0d)) || (ch == 0x20); }