From ee48e6e4dce77253421514a35b0fa3efd831bf25 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 15 Nov 2018 19:22:36 +0000 Subject: [PATCH] thread,mingw64: need intrin.h header for SSE2 MemoryBarrier Needed for compile with `-msse2` (such as implied by `-march=pentium4`) for the i686-w64-mingw64 target triple. This seems like a header mistake, but we can work-around it here by including the header explicitly. Refs: https://sourceforge.net/p/mingw-w64/bugs/712 PR-URL: https://github.com/libuv/libuv/pull/2083 Reviewed-By: Refael Ackermann Reviewed-By: Ben Noordhuis Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Bartosz Sosnowski --- src/win/thread.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/win/thread.c b/src/win/thread.c index 56ca41aab..fd4b7c986 100644 --- a/src/win/thread.c +++ b/src/win/thread.c @@ -23,6 +23,12 @@ #include #include +#if defined(__MINGW64_VERSION_MAJOR) +/* MemoryBarrier expands to __mm_mfence in some cases (x86+sse2), which may + * require this header in some versions of mingw64. */ +#include +#endif + #include "uv.h" #include "internal.h"