aboutsummaryrefslogtreecommitdiff
path: root/src/shared/Util.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-19 17:02:29 -0500
committermegamage <none@none>2009-08-19 17:02:29 -0500
commitf5085b2f39c91ed0103c79d95f8d18a4ef2a6371 (patch)
treecba9f8c0706f9db972cb915d27ee9e7fd3daf1d5 /src/shared/Util.h
parentd7e4392f796f5624a75216f64ae7520c00439cb9 (diff)
[8388] Replaced UTF8PRINT macro by a function
Should also fix possible color leak on Windows CLI. Signed-off-by: freghar <compmancz@gmail.com> --HG-- branch : trunk
Diffstat (limited to 'src/shared/Util.h')
-rw-r--r--src/shared/Util.h27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/shared/Util.h b/src/shared/Util.h
index 496411d8be3..a57c7b2a2f4 100644
--- a/src/shared/Util.h
+++ b/src/shared/Util.h
@@ -285,32 +285,7 @@ std::wstring GetMainPartOfName(std::wstring wname, uint32 declension);
bool utf8ToConsole(const std::string& utf8str, std::string& conStr);
bool consoleToUtf8(const std::string& conStr,std::string& utf8str);
bool Utf8FitTo(const std::string& str, std::wstring search);
-
-#if PLATFORM == PLATFORM_WINDOWS
-#define UTF8PRINTF(OUT,FRM,RESERR) \
-{ \
- char temp_buf[32*1024]; \
- va_list ap; \
- va_start(ap, FRM); \
- size_t temp_len = vsnprintf(temp_buf,32*1024,FRM,ap); \
- va_end(ap); \
- \
- wchar_t wtemp_buf[32*1024]; \
- size_t wtemp_len = 32*1024-1; \
- if(!Utf8toWStr(temp_buf,temp_len,wtemp_buf,wtemp_len)) \
- return RESERR; \
- CharToOemBuffW(&wtemp_buf[0],&temp_buf[0],wtemp_len+1);\
- fprintf(OUT,temp_buf); \
-}
-#else
-#define UTF8PRINTF(OUT,FRM,RESERR) \
-{ \
- va_list ap; \
- va_start(ap, FRM); \
- vfprintf(OUT, FRM, ap ); \
- va_end(ap); \
-}
-#endif
+void utf8printf(FILE *out, const char *str, ...);
bool IsIPAddress(char const* ipaddress);
uint32 CreatePIDFile(const std::string& filename);