From fe325ecdd297d130b41f337c940270d390268d09 Mon Sep 17 00:00:00 2001 From: Karl Fessel Date: Fri, 11 Nov 2022 16:36:56 +0100 Subject: [PATCH] core/lib: compiler_hints guard NORETURN and PURE --- core/lib/include/compiler_hints.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/lib/include/compiler_hints.h b/core/lib/include/compiler_hints.h index c66f8891bd..ba7581cf72 100644 --- a/core/lib/include/compiler_hints.h +++ b/core/lib/include/compiler_hints.h @@ -30,11 +30,13 @@ extern "C" { * @brief The *NORETURN* keyword tells the compiler to assume that the function * cannot return. */ +#ifndef NORETURN #ifdef __GNUC__ #define NORETURN __attribute__((noreturn)) #else #define NORETURN #endif +#endif /** * @def PURE @@ -43,11 +45,13 @@ extern "C" { * function can be subject to common subexpression elimination and loop * optimization just as an arithmetic operator would be. */ +#ifndef PURE #ifdef __GNUC__ #define PURE __attribute__((pure)) #else #define PURE #endif +#endif /** * @def UNREACHABLE()