Haka
compiler.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #ifndef HAKA_COMPILER_H
6 #define HAKA_COMPILER_H
7 
8 #define INLINE static inline
9 
10 #define PACKED __attribute__((packed))
11 
12 #define FORMAT_PRINTF(fmt, args) __attribute__((format(printf, fmt, args)))
13 
14 #define INIT __attribute__((constructor(32767)))
15 #define INIT_P(p) __attribute__((constructor(p)))
16 #define FINI __attribute__((destructor(32767)))
17 #define FINI_P(p) __attribute__((destructor(p)))
18 
19 #define MIN(a, b) ((a) < (b) ? (a) : (b))
20 
21 #define UNUSED __attribute__((unused))
22 
23 #define STATIC_ASSERT(COND, MSG) typedef char static_assertion_##MSG[(COND)?1:-1]
24 
25 #endif /* HAKA_COMPILER_H */