Skip to content

Commit

Permalink
Fix build with i386 and musl libc (#1470)
Browse files Browse the repository at this point in the history
The current code asumes glibc == linux. This patch extends support to all non-glibc Linux systems.

Signed-off-by: Cristian Othón Martínez Vera <cfuga@cfuga.mx>
  • Loading branch information
cfuga authored and cary-ilm committed Jul 31, 2023
1 parent d3034b2 commit ded8f32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/Iex/IexMathFpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
inline void
restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
{
# if (defined(__GLIBC__) && defined(__i386__)) || defined(__ANDROID_API__)
# if (defined(__linux__) && defined(__i386__)) || defined(__ANDROID_API__)
setCw ((ucon.uc_mcontext.fpregs->cw & cwRestoreMask) | cwRestoreVal);
#else
setCw ((ucon.uc_mcontext.fpregs->cwd & cwRestoreMask) | cwRestoreVal);
# endif

_fpstate* kfp = reinterpret_cast<_fpstate*> (ucon.uc_mcontext.fpregs);
# if defined(__GLIBC__) && defined(__i386__)
# if defined(__linux__) && defined(__i386__)
setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions);
#else
setMxcsr (kfp->mxcsr, clearExceptions);
Expand Down

0 comments on commit ded8f32

Please sign in to comment.