From 95b0e1135ca6c3186c64a1c39e5a7dfb7972546f Mon Sep 17 00:00:00 2001 From: Reece Date: Wed, 29 Sep 2021 11:41:27 +0100 Subject: [PATCH] [*] Rename AuDelegate to AuConsumer [+] Added AuSupplier --- Include/AuroraMacros.hpp | 17 +++++++++++++---- Include/AuroraTypedefs.hpp | 5 ++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Include/AuroraMacros.hpp b/Include/AuroraMacros.hpp index 8e285a9f..a7b96f24 100644 --- a/Include/AuroraMacros.hpp +++ b/Include/AuroraMacros.hpp @@ -11,8 +11,13 @@ #define AU_NO_MOVE(type) type(type&&) = delete; #define AU_NO_COPY_NO_MOVE(type) AU_NO_COPY(type) AU_NO_MOVE(type) -#define AU_SHARED_FROM_THIS (std::static_pointer_cast>(this->shared_from_this())) -#define AU_WEAK_FROM_THIS (AuWPtr>(std::static_pointer_cast>(this->shared_from_this()))) +#if !defined(AU_SHARED_FROM_THIS) + #define AU_SHARED_FROM_THIS (std::static_pointer_cast>(this->shared_from_this())) +#endif + +#if !defined(AU_WEAK_FROM_THIS) + #define AU_WEAK_FROM_THIS (AuWPtr>(std::static_pointer_cast>(this->shared_from_this()))) +#endif #define AU_BRACKET_SCOPE(...) __VA_ARGS__ @@ -76,15 +81,19 @@ name ## Shared_t name ## Shared(T... args) \ #if defined(AURORA_COMPILER_MSVC) #define AU_NORETURN __declspec(noreturn) -#else +#elif (defined(AURORA_COMPILER_CLANG) || defined(AURORA_COMPILER_GCC)) + #define AU_ALLOC __attribute__((noreturn)) +#elif defined(AU_LANG_CPP) #define AU_NORETURN [[noreturn]] +#else + #define AU_NORETURN #endif #if defined(AURORA_PLATFORM_WIN32) #define AU_ALLOC __declspec(allocator) #elif defined(AURORA_COMPILER_CLANG) #define AU_ALLOC __declspec(allocator) -#elif defined(AURORA_COMPILER_COMMUNISM) +#elif defined(AURORA_COMPILER_GCC) #define AU_ALLOC __attribute__((malloc)) #else #define AU_ALLOC diff --git a/Include/AuroraTypedefs.hpp b/Include/AuroraTypedefs.hpp index fb993271..07f0ab7c 100644 --- a/Include/AuroraTypedefs.hpp +++ b/Include/AuroraTypedefs.hpp @@ -128,7 +128,10 @@ using AuPredicate = AuFunction; using AuVoidFunc = AuFunction; template -using AuDelegate = AuFunction; +using AuConsumer = AuFunction; + +template +using AuSupplier = AuFunction; //#include "tinyutf8.h"