From db4c4d4bc214f579f5d6540a9f15d0b7b36fbdf8 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 74d9e52b27..0b19b8c5f7 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 */