]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
g-i: Fix compiling with mingw clang
authorBiswapriyo Nath <nathbappai@gmail.com>
Tue, 4 Apr 2023 18:45:21 +0000 (00:15 +0530)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 4 Apr 2023 20:23:05 +0000 (22:23 +0200)
This adds the return type with GetFullPathNameA declaration.
Otherwise the following error is shown with clang 16

grealpath.h:29:19: error: type specifier missing, defaults to 'int';
ISO C99 and later do not support implicit int [-Wimplicit-int]

gobject-introspection/grealpath.h

index f5af7cb58c038293df3c46f1d3e643d44346c670..f8eadd66f1ed00027f5a16ede9b002efc7a6ce3b 100644 (file)
@@ -3,6 +3,14 @@
 
 #include <stdlib.h>
 
+#ifdef _WIN32
+/* We don't want to include <windows.h> as it clashes horribly
+ * with token names from scannerparser.h. So just declare
+ * GetFullPathNameA() here.
+ */
+extern unsigned long __stdcall GetFullPathNameA(const char*, unsigned long, char*, char**);
+#endif
+
 /**
  * g_realpath:
  *
@@ -22,11 +30,6 @@ g_realpath (const char *path)
        else
                return NULL;
 #else
-       /* We don't want to include <windows.h> as it clashes horribly
-        * with token names from scannerparser.h. So just declare
-        * GetFullPathNameA() here.
-        */
-       extern __stdcall GetFullPathNameA(const char*, int, char*, char**);
        char *buffer;
        char dummy;
        int rc, len;