From 963af6449f3fbbb3f9fd79547a33e4f3d5e3f0d0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 9 Sep 2012 14:50:31 +0200 Subject: [PATCH] Cleanup some unused macros from util.h Encapsulate _snprintf/sprintf difference in implementation not header --- src/util.cpp | 4 ++++ src/util.h | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index c9edc782c8..3a5770c91c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -284,7 +284,11 @@ string vstrprintf(const char *format, va_list ap) { va_list arg_ptr; va_copy(arg_ptr, ap); +#ifdef WIN32 ret = _vsnprintf(p, limit, format, arg_ptr); +#else + ret = vsnprintf(p, limit, format, arg_ptr); +#endif va_end(arg_ptr); if (ret >= 0 && ret < limit) break; diff --git a/src/util.h b/src/util.h index b75c3bff4e..90df4efa3b 100644 --- a/src/util.h +++ b/src/util.h @@ -79,11 +79,7 @@ T* alignup(T* p) #define S_IRUSR 0400 #define S_IWUSR 0200 #endif -#define unlink _unlink #else -#define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d) -#define strlwr(psz) to_lower(psz) -#define _strlwr(psz) to_lower(psz) #define MAX_PATH 1024 inline void Sleep(int64 n) { @@ -130,7 +126,6 @@ extern bool fReopenDebugLog; void RandAddSeed(); void RandAddSeedPerfmon(); int ATTR_WARN_PRINTF(1,2) OutputDebugStringF(const char* pszFormat, ...); -int my_snprintf(char* buffer, size_t limit, const char* format, ...); /* Rationale for the real_strprintf / strprintf construction: