File ilmbase-1.0.3-ucontext-i386.patch of Package ilmbase
Index: ilmbase-1.0.3/IexMath/IexMathFpu.cpp
===================================================================
--- ilmbase-1.0.3.orig/IexMath/IexMathFpu.cpp 2012-08-07 09:45:07.911993741 +0200
+++ ilmbase-1.0.3/IexMath/IexMathFpu.cpp 2012-08-07 09:45:09.070993689 +0200
@@ -253,14 +253,7 @@
const uint16_t cwRestoreMask = ~((3 << 10) | (3 << 8));
const uint16_t cwRestoreVal = (0 << 10) | (3 << 8);
-inline void
-restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
-{
- setCw ((ucon.uc_mcontext.fpregs->cwd & cwRestoreMask) | cwRestoreVal);
- setMxcsr (ucon.uc_mcontext.fpregs->mxcsr, clearExceptions);
-}
-
-#if 0
+#if defined(__i386__)
//
// Ugly, the mxcsr isn't defined in GNU libc ucontext_t, but
@@ -280,7 +273,16 @@
setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions);
}
-#endif
+#else
+
+inline void
+restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
+{
+ setCw ((ucon.uc_mcontext.fpregs->cwd & cwRestoreMask) | cwRestoreVal);
+ setMxcsr (ucon.uc_mcontext.fpregs->mxcsr, clearExceptions);
+}
+
+#endif //restoreControlRegs for i386
} // namespace FpuControl