Permalink
Browse files

Fix compilation with mingw

grealpath.h defines GetFullPathNameA() as windows.h is
not imported, but for gitscanner.c, windows.h is imported and the compiler
throws an error.
  • Loading branch information...
ylatuya authored and cgwalters committed Sep 3, 2011
1 parent fa4a01b commit 0f081d7bda792548348b330f4a99ef3788709ea6
Showing with 11 additions and 1 deletion.
  1. +4 −0 giscanner/giscannermodule.c
  2. +7 −1 giscanner/grealpath.h
@@ -24,6 +24,10 @@
#endif
#include <Python.h>
#include "sourcescanner.h"
+
+#ifdef G_OS_WIN32
+#define USE_WINDOWS
+#endif
#include "grealpath.h"
#ifdef _WIN32
View
@@ -2,6 +2,9 @@
#define __G_REALPATH_H__
#include <stdlib.h>
+#ifdef USE_WINDOWS
+#include <windows.h>
+#endif
/**
* g_realpath:
@@ -24,9 +27,12 @@ g_realpath (const char *path)
#else
/* We don't want to include <windows.h> as it clashes horribly
* with token names from scannerparser.h. So just declare
- * GetFullPathNameA() here.
+ * GetFullPathNameA() here unless we already defined it, like
+ * in giscanner.c.
*/
+#ifndef USE_WINDOWS
extern __stdcall GetFullPathNameA(const char*, int, char*, char**);
+#endif
char *buffer;
char dummy;
int rc, len;

0 comments on commit 0f081d7

Please sign in to comment.