From f628377e9218c7ac262a4ec5c8143a3dd3b18a9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 31 Oct 2011 13:57:53 +0000 Subject: [PATCH] Fix os::Path::format on MinwGW. --- common/os_path.hpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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. */ -- 2.43.0