aboutsummaryrefslogtreecommitdiffstats
path: root/testing/opencascade/no_feenableexcept.patch
blob: f524008151a4f7683faaf6298aa85baf584a1626 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
musl does not provice feenableexcept and fedisableexcept. Those calls have
only been used on linux so far. This patch extends the #ifdef logic to only use
them on Linux if additionally glibc is used.
--- occt-V7_3_0p3.old/src/OSD/OSD_signal.cxx
+++ occt-V7_3_0p3/src/OSD/OSD_signal.cxx
@@ -687,7 +687,7 @@
   // cout << "OSD::Handler: signal " << (int) theSignal << " occured inside a try block " <<  endl ;
   if ( ADR_ACT_SIGIO_HANDLER != NULL )
     (*ADR_ACT_SIGIO_HANDLER)() ;
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__)
   if (fFltExceptions)
     feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
     //feenableexcept (FE_INVALID | FE_DIVBYZERO);
@@ -805,7 +805,7 @@
   (void)theSignal; // silence GCC warnings
   (void)theContext;
 
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__)
   if (fFltExceptions)
     feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
     //feenableexcept (FE_INVALID | FE_DIVBYZERO);
@@ -891,14 +891,14 @@
       cerr << "ieee_handler does not work !!! KO " << endl;
 #endif
     }
-#elif defined (__linux__)
+#elif defined(__linux__) && defined(__GLIBC__)
     feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
     fFltExceptions = Standard_True;
 #endif
   }
   else
   {
-#if defined (__linux__)
+#if defined(__linux__) && defined(__GLIBC__)
     fedisableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
     fFltExceptions = Standard_False;
 #endif