w32pthreads: fix mingw build on x86 with -msse2 or higher
authorHendrik Leppkes <h.leppkes@gmail.com>
Wed, 14 Oct 2015 21:20:09 +0000 (23:20 +0200)
committerHendrik Leppkes <h.leppkes@gmail.com>
Fri, 16 Oct 2015 12:54:48 +0000 (14:54 +0200)
When SSE2 or higher compiler optimizations are used, mingw uses
the _mm_mfence intrinsic for MemoryBarrier, however it doesn't include
the appropriate headers automatically.

compat/w32pthreads.h

index c25a191..3a2f68f 100644 (file)
 #include <windows.h>
 #include <process.h>
 
+/* MinGW requires the intrinsics header for the pthread_once fallback code */
+#if _WIN32_WINNT < 0x0600 && defined(__MINGW32__)
+#include <intrin.h>
+#endif
+
 #include "libavutil/attributes.h"
 #include "libavutil/common.h"
 #include "libavutil/internal.h"