From 2dcce6d53bfc6708a57b36ab272dcd36526ee9ec Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Sat, 13 Mar 2021 19:09:55 -0800 Subject: [PATCH] introduce MA_RESTRICT macro This allows us to use the __restrict keyword in places where we know that pointers do not alias. Signed-off-by: Steven Noonan --- miniaudio.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/miniaudio.h b/miniaudio.h index 6d648d61..728da361 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -6752,6 +6752,14 @@ static MA_INLINE ma_bool32 ma_has_neon(void) #endif #endif +#ifndef MA_RESTRICT + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + #define MA_RESTRICT __restrict + #else + #define MA_RESTRICT + #endif +#endif + #if defined(_MSC_VER) && _MSC_VER >= 1400 #define MA_HAS_BYTESWAP16_INTRINSIC #define MA_HAS_BYTESWAP32_INTRINSIC