From ad980b23b7ef7d58fbde7abb2bdf560670419d68 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 29 Jul 2015 14:26:30 +0000 Subject: [PATCH] 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 --- compat/mingw.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compat/mingw.h b/compat/mingw.h index 7d52d02f3c..6344d991e3 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -6,6 +6,12 @@ typedef _sigset_t sigset_t; #endif #include #include + +/* MinGW-w64 reports to have flockfile, but it does not actually have it. */ +#ifdef __MINGW64_VERSION_MAJOR +#undef _POSIX_THREAD_SAFE_FUNCTIONS +#endif + /* * things that are not available in header files */