From a5d696214811cfa67dbab32e4a440f64d6ab4c76 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 3 Mar 2021 23:03:38 +0100 Subject: [PATCH] AK+Kernel: Remove NO_DISCARD macro hack This was added as clang-format would mess up the formatting when using [[nodiscard]] on a class, which is no longer the case. --- AK/Platform.h | 5 ----- Kernel/SpinLock.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/AK/Platform.h b/AK/Platform.h index 99fb61c8df..e1a15f78eb 100644 --- a/AK/Platform.h +++ b/AK/Platform.h @@ -60,11 +60,6 @@ #endif #define FLATTEN [[gnu::flatten]] -#ifdef NO_DISCARD -# undef NO_DISCARD -#endif -#define NO_DISCARD [[nodiscard]] - #ifndef __serenity__ # define PAGE_SIZE sysconf(_SC_PAGESIZE) #endif diff --git a/Kernel/SpinLock.h b/Kernel/SpinLock.h index c5729d9e08..a8cd389477 100644 --- a/Kernel/SpinLock.h +++ b/Kernel/SpinLock.h @@ -126,7 +126,7 @@ private: }; template -class NO_DISCARD ScopedSpinLock { +class [[nodiscard]] ScopedSpinLock { AK_MAKE_NONCOPYABLE(ScopedSpinLock);