Skip to content

Commit

Permalink
g-i: Fix compiling with mingw clang
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
Biswa96 authored and ricotz committed Apr 4, 2023
1 parent 914c741 commit 6ad0e23
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions gobject-introspection/grealpath.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
*
Expand All @@ -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;
Expand Down

0 comments on commit 6ad0e23

Please sign in to comment.