Skip to content

Commit

Permalink
thread,mingw64: need intrin.h header for SSE2 MemoryBarrier
Browse files Browse the repository at this point in the history
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: libuv#2083
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Bartosz Sosnowski <[email protected]>
  • Loading branch information
vtjnash committed Jan 4, 2019
1 parent 2d2af38 commit ee48e6e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/win/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit ee48e6e

Please sign in to comment.