libyggdrasil  v1.0.0
attributes.h
Go to the documentation of this file.
1  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * _____.___. .___ .__.__ *
3  * \__ | | ____ ____ __| _/___________ _____|__| | *
4  * / | |/ ___\ / ___\ / __ |\_ __ \__ \ / ___/ | | *
5  * \____ / /_/ > /_/ > /_/ | | | \// __ \_\___ \| | |__ *
6  * / ______\___ /\___ /\____ | |__| (____ /____ >__|____/ *
7  * \/ /_____//_____/ \/ \/ \/ *
8  * - Common - *
9  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
10  * This software can be used by students and other personal of the *
11  * Bern University of Applied Sciences under the terms of the MIT *
12  * license. *
13  * For other persons this software is under the terms of the GNU *
14  * General Public License version 2. *
15  * *
16  * Copyright © 2021, Bern University of Applied Sciences. *
17  * All rights reserved. *
18  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
26 #pragma once
27 
28 #define LIKELY __attribute__((likely))
29 #define UNLIKELY __attribute__((unlikely))
30 #define DEPRECTATED(reason) __attribute__((deprecated))
31 #define NO_RETURN __attribute__((noreturn))
32 
33 #define WEAK __attribute__((weak))
34 #define ALWAYS_INLINE __attribute__((always_inline)) inline
35 #define PACKED __attribute__((packed))
36 #define NAKED __attribute__((naked))
37 #define SECTION(name) __attribute__((section(name)))
38 #define ALIGNED(alignment) __attribute__((aligned(alignment)))
39 
40 #if defined(__cplusplus)
41  #define C_LINKAGE extern "C"
42 #else
43  #define C_LINKAGE
44 #endif