Contiki-NG
|
Default definitions of C compiler quirk work-arounds. More...
#include "contiki.h"
Go to the source code of this file.
Macros | |
#define | ASSUME(c) |
Configure if the C compiler supports taking hints from the user about invariants, e.g. | |
#define | CC_NORETURN |
Configure if the C compiler supports functions that are not meant to return e.g. | |
#define | CC_CONSTRUCTOR(prio) |
Configure if the C compiler supports marking functions as constructors e.g. | |
#define | CC_DESTRUCTOR(prio) |
Configure if the C compiler supports marking functions as destructors e.g. | |
#define | CC_DEPRECATED(msg) |
Configure if the C compiler supports marking functions as deprecated e.g. | |
#define | CC_ACCESS_NOW(type, variable) (*(volatile type *)&(variable)) |
This macro ensures that the access to a non-volatile variable can not be reordered or optimized by the compiler. | |
#define | CC_CONCAT(s1, s2) CC_CONCAT2(s1, s2) |
A C preprocessing macro for concatenating two preprocessor tokens. | |
#define | CC_CONCAT3(s1, s2, s3) s1##s2##s3 |
A C preprocessing macro for concatenating three preprocessor tokens. | |
Default definitions of C compiler quirk work-arounds.
This file is used for making use of extra functionality of some C compilers used for Contiki, and defining work-arounds for various quirks and problems with some other C compilers.
Definition in file cc.h.
#define ASSUME | ( | c | ) |
#define CC_ACCESS_NOW | ( | type, | |
variable ) (*(volatile type *)&(variable)) |
This macro ensures that the access to a non-volatile variable can not be reordered or optimized by the compiler.
See also https://lwn.net/Articles/508991/ - In Linux the macro is called ACCESS_ONCE The type must be passed, because the typeof-operator is a gcc extension
Definition at line 145 of file cc.h.
Referenced by ringbuf_get(), and ringbuf_put().
#define CC_CONCAT | ( | s1, | |
s2 ) CC_CONCAT2(s1, s2) |
#define CC_CONSTRUCTOR | ( | prio | ) |
#define CC_DEPRECATED | ( | msg | ) |
#define CC_DESTRUCTOR | ( | prio | ) |