Files
MINGW-packages/mingw-w64-opencascade/0014-aarch64-mm_alloc.patch
مهدي شينون (Mehdi Chinoune) cffbf413fa opencascade: update to 7.9.2
2025-10-24 10:56:08 +01:00

42 lines
1.7 KiB
Diff

From c1e0fcab5f19ca26e2f7fa72644f437cd86fdcf8 Mon Sep 17 00:00:00 2001
From: Hernan Martinez <hernan.c.martinez@gmail.com>
Date: Tue, 21 Feb 2023 15:22:29 -0700
Subject: [PATCH] aarch64 mm_alloc
Support aarch64 builds
---
src/Standard/Standard.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Standard/Standard.cxx b/src/Standard/Standard.cxx
index 8467bc3bd1..250d7c0e6a 100644
--- a/src/Standard/Standard.cxx
+++ b/src/Standard/Standard.cxx
@@ -26,7 +26,7 @@
#if defined(_MSC_VER) || defined(__ANDROID__) || defined(__QNX__)
#include <malloc.h>
#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
- && (defined(__i386) || defined(__x86_64)))
+ && (defined(__i386) || defined(__x86_64) || defined(__aarch64__)))
#include <mm_malloc.h>
#else
extern "C" int posix_memalign(void** thePtr, size_t theAlign, size_t theSize);
@@ -479,7 +479,7 @@
#elif defined(__ANDROID__) || defined(__QNX__)
return memalign(theAlign, theSize);
#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
- && (defined(__i386) || defined(__x86_64)))
+ && (defined(__i386) || defined(__x86_64) || defined(__aarch64__)))
return _mm_malloc(theSize, theAlign);
#else
void* aPtr;
@@ -506,7 +506,7 @@
#elif defined(__ANDROID__) || defined(__QNX__)
free(thePtrAligned);
#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
- && (defined(__i386) || defined(__x86_64)))
+ && (defined(__i386) || defined(__x86_64) || defined(__aarch64__)))
_mm_free(thePtrAligned);
#else
free(thePtrAligned);