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 <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
This commit is contained in:
Jameson Nash 2018-11-15 19:22:36 +00:00
parent 2d2af382ce
commit ee48e6e4dc

View File

@ -23,6 +23,12 @@
#include <limits.h>
#include <stdlib.h>
#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 <intrin.h>
#endif
#include "uv.h"
#include "internal.h"