aboutsummaryrefslogtreecommitdiffstats
path: root/testing/opencascade/no_feenableexcept.patch
blob: 21d9e699e6a43978340ff196bf71f11efe55a5ff (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
41
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_4_0-org/src/OSD/OSD_signal.cxx
+++ occt-V7_4_0/src/OSD/OSD_signal.cxx
@@ -678,7 +678,7 @@
 // POSIX threads
 #include <pthread.h>
 
-#ifdef __linux__
+#ifdef __linux__ && defined(__GLIBC__)
 #include  <cfenv>
 //#include  <fenv.h>
 #endif
@@ -793,7 +793,7 @@
   case SIGFPE:
     sigaddset(&set, SIGFPE);
     sigprocmask(SIG_UNBLOCK, &set, NULL) ;
-#ifdef __linux__
+#ifdef __linux__ && defined(__GLIBC__)
     OSD::SetFloatingSignal (Standard_True);
 #endif
 #if (!defined (__sun)) && (!defined(SOLARIS))
@@ -914,7 +914,7 @@
 //=======================================================================
 void OSD::SetFloatingSignal (Standard_Boolean theFloatingSignal)
 {
-#if defined (__linux__)
+#if defined (__linux__) && defined(__GLIBC__)
   feclearexcept (FE_ALL_EXCEPT);
   if (theFloatingSignal)
   {
@@ -947,7 +947,7 @@
 //=======================================================================
 Standard_Boolean OSD::ToCatchFloatingSignals()
 {
-#if defined (__linux__)
+#if defined (__linux__) && defined(__GLIBC__)
   return (fegetexcept() & _OSD_FPX) != 0;
 #else
   return Standard_False;