]> git.cworth.org Git - apitrace/commitdiff
Fix os::Path::format on MinwGW.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 31 Oct 2011 13:57:53 +0000 (13:57 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 31 Oct 2011 13:57:53 +0000 (13:57 +0000)
common/os_path.hpp

index 33f9f33f5af2e0edde6b8539646c9875532cd1ab..23b87d1b0ce58f30c7f61fc6bbe71823d19f8829 100644 (file)
 
 
 #include <assert.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stddef.h>
+
+#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 <vector>
 
@@ -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.
          */