From eee44c85d4a1aa66d0e71f7ae0ce330408f698ff Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Sun, 20 Jun 2021 16:59:51 +0200 Subject: [PATCH] AK: Use `__attribute__((name))` for functions everywhere Clang enforces the ordering that attributes specified with the `[[attr_name]]` syntax must comes before those defines as `__attribute__((attr_name))`. We don't want to deal with that, so we should stick to a single syntax (for functions, at least). This commit favors the latter, as it's used more widely in the code (for declaring more "exotic" options), and changing those would be a larger effort than modifying this single file. --- AK/Platform.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AK/Platform.h b/AK/Platform.h index 4c1ef2d417..54264348b4 100644 --- a/AK/Platform.h +++ b/AK/Platform.h @@ -28,22 +28,22 @@ #ifdef ALWAYS_INLINE # undef ALWAYS_INLINE #endif -#define ALWAYS_INLINE [[gnu::always_inline]] inline +#define ALWAYS_INLINE __attribute__((always_inline)) inline #ifdef NEVER_INLINE # undef NEVER_INLINE #endif -#define NEVER_INLINE [[gnu::noinline]] +#define NEVER_INLINE __attribute__((noinline)) #ifdef FLATTEN # undef FLATTEN #endif -#define FLATTEN [[gnu::flatten]] +#define FLATTEN __attribute__((flatten)) #ifdef NO_SANITIZE_ADDRESS # undef NO_SANITIZE_ADDRESS #endif -#define NO_SANITIZE_ADDRESS [[gnu::no_sanitize_address]] +#define NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) // GCC doesn't have __has_feature but clang does #ifndef __has_feature