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()