Skip to content

Commit ed4d330

Browse files
committed
Work around MinGW-w64 erroneously claiming to have flockfile()
The _POSIX_THREAD_SAFE_FUNCTIONS constant is supposed to be defined only if flockfile() and friends are available. MinGW-w64 defines that constant, but the functions are not available. Work around that. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 0319703 commit ed4d330

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compat/mingw.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ typedef _sigset_t sigset_t;
66
#endif
77
#include <winsock2.h>
88
#include <ws2tcpip.h>
9+
10+
/* MinGW-w64 reports to have flockfile, but it does not actually have it. */
11+
#ifdef __MINGW64_VERSION_MAJOR
12+
#undef _POSIX_THREAD_SAFE_FUNCTIONS
13+
#endif
14+
915
/*
1016
* things that are not available in header files
1117
*/

0 commit comments

Comments
 (0)