From: José Fonseca Date: Mon, 31 Oct 2011 13:57:53 +0000 (+0000) Subject: Fix os::Path::format on MinwGW. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=f628377e9218c7ac262a4ec5c8143a3dd3b18a9c;p=apitrace Fix os::Path::format on MinwGW. --- diff --git a/common/os_path.hpp b/common/os_path.hpp index 33f9f33..23b87d1 100644 --- a/common/os_path.hpp +++ b/common/os_path.hpp @@ -32,6 +32,23 @@ #include +#include +#include +#include + +#ifdef __MINGW32__ +// Some versions of are missing _vscprintf's decleration, although still +// provide the symbol in the import library. +extern "C" _CRTIMP int _vscprintf(const char *format, va_list argptr); +#endif + +#ifndef va_copy +#ifdef __va_copy +#define va_copy(dest, src) __va_copy((dest), (src)) +#else +#define va_copy(dest, src) (dest) = (src) +#endif +#endif #include @@ -158,7 +175,7 @@ public: int length; va_list args_copy; va_copy(args_copy, args); -#ifdef _MSC_VER +#ifdef _WIN32 /* We need to use _vcsprintf to calculate the length as vsnprintf returns -1 * if the number of characters to write is greater than count. */