diff options
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/util.h b/src/util.h index 4fa5a08982..0af5b0a2c5 100644 --- a/src/util.h +++ b/src/util.h @@ -11,6 +11,8 @@ #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> +#else +typedef int pid_t; /* define for windows compatiblity */ #endif #include <map> #include <vector> @@ -128,8 +130,15 @@ void RandAddSeed(); void RandAddSeedPerfmon(); int OutputDebugStringF(const char* pszFormat, ...); int my_snprintf(char* buffer, size_t limit, const char* format, ...); -std::string strprintf(const std::string &format, ...); -bool error(const std::string &format, ...); + +/* It is not allowed to use va_start with a pass-by-reference argument. + (C++ standard, 18.7, paragraph 3). Use a dummy argument to work around this, and use a + macro to keep similar semantics. +*/ +std::string real_strprintf(const std::string &format, int dummy, ...); +#define strprintf(format, ...) real_strprintf(format, 0, __VA_ARGS__) + +bool error(const char *format, ...); void LogException(std::exception* pex, const char* pszThread); void PrintException(std::exception* pex, const char* pszThread); void PrintExceptionContinue(std::exception* pex, const char* pszThread); |