From 594235b3042e2e68f22b2aa40e8383c2dbb43a13 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Tue, 18 Jun 2024 14:08:46 +0100 Subject: [PATCH] [*] Force inlining of AuMemset/cpy under clang --- Include/auROXTL/auMemoryUtils.hpp | 32 +++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/Include/auROXTL/auMemoryUtils.hpp b/Include/auROXTL/auMemoryUtils.hpp index e2bf819..da19d33 100644 --- a/Include/auROXTL/auMemoryUtils.hpp +++ b/Include/auROXTL/auMemoryUtils.hpp @@ -23,19 +23,35 @@ static auline int AuMemcmp(const void *dest, const void *src, size_t n) #define AURORA_RUNTIME_MEMSET std::memset #endif -static auline void *AuMemset(void *dest, AuUInt8 c, size_t n) -{ - return AURORA_RUNTIME_MEMSET(dest, c, n); -} +#if defined(AURORA_RUNTIME_MEMSET_) && AURORA_RUNTIME_MEMSET_ == 1 + + #define AuMemset AURORA_RUNTIME_MEMSET + +#else + + static auline void *AuMemset(void *dest, AuUInt8 c, size_t n) + { + return AURORA_RUNTIME_MEMSET(dest, c, n); + } + +#endif #if !defined(AURORA_RUNTIME_MEMCPY) #define AURORA_RUNTIME_MEMCPY std::memcpy #endif -static auline void *AuMemcpy(void *dest, const void *src, size_t n) -{ - return AURORA_RUNTIME_MEMCPY(dest, src, n); -} +#if defined(AURORA_RUNTIME_MEMCPY_) && AURORA_RUNTIME_MEMCPY_ == 1 + + #define AuMemcpy AURORA_RUNTIME_MEMCPY + +#else + + static auline void *AuMemcpy(void *dest, const void *src, size_t n) + { + return AURORA_RUNTIME_MEMCPY(dest, src, n); + } + +#endif #if !defined(AURORA_RUNTIME_MEMMOVE) #define AURORA_RUNTIME_MEMMOVE std::memmove