]>
Commit | Line | Data |
---|---|---|
cc73685d | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
d7f19646 CB |
2 | |
3 | #ifndef __LXC_COMPILER_H | |
4 | #define __LXC_COMPILER_H | |
5 | ||
d38dd64a CB |
6 | #ifndef _GNU_SOURCE |
7 | #define _GNU_SOURCE 1 | |
8 | #endif | |
d17947f8 | 9 | |
d7f19646 CB |
10 | #include "config.h" |
11 | ||
12 | #ifndef thread_local | |
13 | #if __STDC_VERSION__ >= 201112L && \ | |
14 | !(defined(__STDC_NO_THREADS__) || \ | |
15 | (defined(__GNU_LIBRARY__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 16)) | |
16 | #define thread_local _Thread_local | |
17 | #else | |
18 | #define thread_local __thread | |
19 | #endif | |
20 | #endif | |
21 | ||
c73fbad1 CB |
22 | #ifndef __fallthrough |
23 | #define __fallthrough /* fall through */ | |
cf0fd972 CB |
24 | #endif |
25 | ||
d17947f8 CB |
26 | #ifndef __noreturn |
27 | # if __STDC_VERSION__ >= 201112L | |
28 | # if !IS_BIONIC | |
29 | # define __noreturn _Noreturn | |
30 | # else | |
31 | # define __noreturn __attribute__((__noreturn__)) | |
32 | # endif | |
33 | # elif IS_BIONIC | |
34 | # define __noreturn __attribute__((__noreturn__)) | |
35 | # else | |
36 | # define __noreturn __attribute__((noreturn)) | |
37 | # endif | |
cf0fd972 CB |
38 | #endif |
39 | ||
afeec9b7 CB |
40 | #ifndef __hot |
41 | # define __hot __attribute__((hot)) | |
42 | #endif | |
43 | ||
633cb8be CB |
44 | #ifndef __returns_twice |
45 | #define __returns_twice __attribute__((returns_twice)) | |
46 | #endif | |
47 | ||
1a080cd7 CB |
48 | /* This attribute is required to silence clang warnings */ |
49 | #if defined(__GNUC__) | |
53675a8d | 50 | #define __lxc_unused __attribute__ ((unused)) |
1a080cd7 | 51 | #else |
53675a8d | 52 | #define __lxc_unused |
1a080cd7 CB |
53 | #endif |
54 | ||
b857f4be CB |
55 | #define __cgfsng_ops |
56 | ||
d7f19646 | 57 | #endif /* __LXC_COMPILER_H */ |