Skip to content

Commit

Permalink
cpu: fix MinGW-w64 build. Closes #237
Browse files Browse the repository at this point in the history
* Fixed by Jeffrey Walton (noloader)
  • Loading branch information
anonimal committed Aug 1, 2016
1 parent 3f6d499 commit bf9809e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -176,7 +183,10 @@ static bool TrySSE2()
#endif
}

# ifndef __MINGW32__
sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULL);
# endif

signal(SIGILL, oldHandler);
return result;
#endif
Expand Down

0 comments on commit bf9809e

Please sign in to comment.