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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2015-07-29 14:26:30 +00:00
parent 1ed5b6e5d7
commit ad980b23b7

View File

@@ -6,6 +6,12 @@ typedef _sigset_t sigset_t;
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
/* 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
*/