Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IexMathFpu.cpp: Fix build on non-glibc (e.g. musl libc). #798

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions IlmBase/IexMath/IexMathFpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,18 @@ restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
inline void
restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
{
#if defined(__GLIBC__) || defined(__i386__)
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__)
setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions);
#else
setMxcsr (kfp->mxcsr, clearExceptions);
#endif
}

#endif
Expand Down