From bf9809ef5700a77ed3ea164f3bd6f7d3d0d6781c Mon Sep 17 00:00:00 2001 From: anonimal Date: Mon, 1 Aug 2016 19:56:43 +0000 Subject: [PATCH] cpu: fix MinGW-w64 build. Closes #237 * Fixed by Jeffrey Walton (noloader) --- cpu.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cpu.cpp b/cpu.cpp index 532c5a14..ce9fc2ee 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -101,9 +101,11 @@ bool CpuId(word32 input, word32 output[4]) if (oldHandler == SIG_ERR) return false; +# ifndef __MINGW32__ volatile sigset_t oldMask; if (sigprocmask(0, NULL, (sigset_t*)&oldMask)) return false; +# endif if (setjmp(s_jmpNoCPUID)) result = false; @@ -123,7 +125,10 @@ bool CpuId(word32 input, word32 output[4]) ); } +# ifndef __MINGW32__ sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULL); +# endif + signal(SIGILL, oldHandler); return result; #endif @@ -160,9 +165,11 @@ static bool TrySSE2() if (oldHandler == SIG_ERR) return false; +# ifndef __MINGW32__ volatile sigset_t oldMask; if (sigprocmask(0, NULL, (sigset_t*)&oldMask)) return false; +# endif if (setjmp(s_jmpNoSSE2)) result = false; @@ -176,7 +183,10 @@ static bool TrySSE2() #endif } +# ifndef __MINGW32__ sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULL); +# endif + signal(SIGILL, oldHandler); return result; #endif