From 50027520f70ac9767112b9fd4d321a9a9e5745b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sat, 19 Sep 2020 00:49:54 +0200 Subject: [PATCH] ksys: Add defines for some function attributes --- src/KingSystem/Utils/HeapUtil.h | 2 +- src/KingSystem/Utils/Types.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/KingSystem/Utils/HeapUtil.h b/src/KingSystem/Utils/HeapUtil.h index bc6730c6..b5629aa7 100644 --- a/src/KingSystem/Utils/HeapUtil.h +++ b/src/KingSystem/Utils/HeapUtil.h @@ -102,7 +102,7 @@ sead::Heap* getCurrentHeap(); sead::Heap* getDebugHeap(); sead::Heap* getDebugHeap2(); -[[gnu::always_inline]] inline sead::Heap* tryCreateDualHeap(sead::Heap* parent) { +KSYS_ALWAYS_INLINE inline sead::Heap* tryCreateDualHeap(sead::Heap* parent) { size_t size; if (const auto* parent_ex = sead::DynamicCast(parent)) { diff --git a/src/KingSystem/Utils/Types.h b/src/KingSystem/Utils/Types.h index cc2b6e4b..941ec17c 100644 --- a/src/KingSystem/Utils/Types.h +++ b/src/KingSystem/Utils/Types.h @@ -7,3 +7,8 @@ #else #define KSYS_CHECK_SIZE_NX150(CLASS, SIZE) static_assert(sizeof(CLASS) == SIZE) #endif + +#ifdef __GNUC__ +#define KSYS_ALWAYS_INLINE [[gnu::always_inline]] +#define KSYS_VISIBILITY_HIDDEN [[gnu::visibility("hidden")]] +#endif