Skip to content

Commit 45c525f

Browse files
committed
mingw: Fix the MSYS1 build
In contrast to MSYS2, MSYS1 not only defines REPARSE_DATA_BUFFER in "ntifs.h" but also in "winnt.h". Luckily, we can distinguish between MSYS1's and MSYS2's "winnt.h" by looking at the include-guards: While MSYS1 defines "_WINNT_H", MSYS2 defines "_WINNT_". Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 57190ae commit 45c525f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compat/mingw.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,9 +2162,11 @@ int symlink(const char *target, const char *link)
21622162
return 0;
21632163
}
21642164

2165+
#ifndef _WINNT_H
21652166
/*
2166-
* The REPARSE_DATA_BUFFER structure is only defined in the Windows DDK (in
2167-
* Ntifs.h), so we have to define it ourselves.
2167+
* The REPARSE_DATA_BUFFER structure is defined in the Windows DDK (in
2168+
* ntifs.h) and in MSYS1's winnt.h (which defines _WINNT_H). So define
2169+
* it ourselves if we are on MSYS2 (whose winnt.h defines _WINNT_).
21682170
*/
21692171
typedef struct _REPARSE_DATA_BUFFER {
21702172
DWORD ReparseTag;
@@ -2191,6 +2193,7 @@ typedef struct _REPARSE_DATA_BUFFER {
21912193
} GenericReparseBuffer;
21922194
} DUMMYUNIONNAME;
21932195
} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
2196+
#endif
21942197

21952198
int readlink(const char *path, char *buf, size_t bufsiz)
21962199
{

0 commit comments

Comments
 (0)