mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
core/lib: compiler_hints guard NORETURN and PURE
This commit is contained in:
parent
ba3ccfe32e
commit
fe325ecdd2
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user