Last active
April 14, 2024 12:40
-
-
Save ctarbide/18ae9fdda6f39a247254fafc7eafc3a0 to your computer and use it in GitHub Desktop.
build Open CASCADE (OCCT) V7_8_1 under musl libc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/OSD/OSD_MemInfo.cxx b/src/OSD/OSD_MemInfo.cxx | |
index 8a9f10e09d..0406ef15b0 100644 | |
--- a/src/OSD/OSD_MemInfo.cxx | |
+++ b/src/OSD/OSD_MemInfo.cxx | |
@@ -13,6 +13,8 @@ | |
// Alternatively, this file may be used under the terms of Open CASCADE | |
// commercial license or contractual agreement. | |
+#define __GENERIC_LIB_C__ | |
+ | |
#if (defined(_WIN32) || defined(__WIN32__)) | |
#include <windows.h> | |
#include <winbase.h> | |
@@ -184,12 +186,14 @@ void OSD_MemInfo::Update() | |
#endif | |
#endif | |
+#ifndef __GENERIC_LIB_C__ | |
#ifdef HAS_MALLINFO2 | |
const struct mallinfo2 aMI = mallinfo2(); | |
#else | |
const struct mallinfo aMI = mallinfo(); | |
#endif | |
myCounters[MemHeapUsage] = aMI.uordblks; | |
+#endif | |
} | |
if (!IsActive (MemVirtual) | |
diff --git a/src/OSD/OSD_signal.cxx b/src/OSD/OSD_signal.cxx | |
index 7da3f19004..7fc75a0c2d 100644 | |
--- a/src/OSD/OSD_signal.cxx | |
+++ b/src/OSD/OSD_signal.cxx | |
@@ -11,6 +11,7 @@ | |
// Alternatively, this file may be used under the terms of Open CASCADE | |
// commercial license or contractual agreement. | |
+#define __GENERIC_LIB_C__ | |
#include <OSD.hxx> | |
#include <OSD_Exception_CTRL_BREAK.hxx> | |
@@ -976,6 +977,7 @@ void OSD::SetFloatingSignal (Standard_Boolean theFloatingSignal) | |
{ | |
#if defined (__linux__) | |
feclearexcept (FE_ALL_EXCEPT); | |
+#ifndef __GENERIC_LIB_C__ | |
if (theFloatingSignal) | |
{ | |
feenableexcept (_OSD_FPX); | |
@@ -984,6 +986,7 @@ void OSD::SetFloatingSignal (Standard_Boolean theFloatingSignal) | |
{ | |
fedisableexcept (_OSD_FPX); | |
} | |
+#endif | |
#elif defined (__sun) || defined (SOLARIS) | |
int aSunStat = 0; | |
sigfpe_handler_type anFpeHandler = (theFloatingSignal ? (sigfpe_handler_type)Handler : NULL); | |
@@ -1007,7 +1010,7 @@ void OSD::SetFloatingSignal (Standard_Boolean theFloatingSignal) | |
//======================================================================= | |
Standard_Boolean OSD::ToCatchFloatingSignals() | |
{ | |
-#if defined (__linux__) | |
+#if defined (__linux__) && !defined(__GENERIC_LIB_C__) | |
return (fegetexcept() & _OSD_FPX) != 0; | |
#else | |
return Standard_False; | |
diff --git a/src/Standard/Standard_StackTrace.cxx b/src/Standard/Standard_StackTrace.cxx | |
index 271c7e2b3b..3738ccd300 100644 | |
--- a/src/Standard/Standard_StackTrace.cxx | |
+++ b/src/Standard/Standard_StackTrace.cxx | |
@@ -12,6 +12,8 @@ | |
// Alternatively, this file may be used under the terms of Open CASCADE | |
// commercial license or contractual agreement. | |
+#define __GENERIC_LIB_C__ | |
+ | |
#include <Standard.hxx> | |
#include <Message.hxx> | |
@@ -313,6 +315,9 @@ Standard_Boolean Standard::StackTrace (char* theBuffer, | |
Message::SendTrace ("Standard::StackTrace() is not implemented for this CPU architecture"); | |
return false; | |
#endif | |
+#elif defined(__GENERIC_LIB_C__) | |
+ Message::SendTrace ("Standard::StackTrace() is not implemented"); | |
+ return false; | |
#else | |
const int aTopSkip = theNbTopSkip + 1; // skip this function call and specified extra number | |
int aNbTraces = theNbTraces + aTopSkip; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment