From 973a57a09603a46fe19ebe0c59b9615952b622e9 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 27 Dec 2020 16:14:17 +0100 Subject: macros: add CONST (__attribute((__const__))) --- macros.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'macros.h') diff --git a/macros.h b/macros.h index 323b3748..4d63404c 100644 --- a/macros.h +++ b/macros.h @@ -26,6 +26,12 @@ #define UNUSED #endif +#if HAS_ATTRIBUTE(const) + #define CONST __attribute__((__const__)) +#else + #define CONST +#endif + #if GNUC_AT_LEAST(3, 0) || HAS_ATTRIBUTE(malloc) #define MALLOC __attribute__((__malloc__)) #else -- cgit v1.3 From 7d0fb3cccd2b43c459bdf08a69254e974c361169 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 1 Jan 2021 22:29:12 +0100 Subject: macros: add NOINLINE (__attribute__((noinline))) --- macros.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'macros.h') diff --git a/macros.h b/macros.h index 4d63404c..d4621bd5 100644 --- a/macros.h +++ b/macros.h @@ -26,6 +26,12 @@ #define UNUSED #endif +#if HAS_ATTRIBUTE(noinline) + #define NOINLINE __attribute__((noinline)) +#else + #define NOINLINE +#endif + #if HAS_ATTRIBUTE(const) #define CONST __attribute__((__const__)) #else -- cgit v1.3