diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-03-18 23:14:03 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-04-03 20:22:41 +0200 |
commit | 52d3a48128b66e731afd54cec7cab0a687d303cf (patch) | |
tree | ade3bfd91c7e92ed83ea79219ed773fbc009ee0e /src/util.h | |
parent | 703d64469eb2b607adcd864555b5fe1d981bf51f (diff) |
VC2010 compile fixes
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); |