1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LINUX_COMPILER_TYPES_H
3 #define __LINUX_COMPILER_TYPES_H
8 * __has_builtin is supported on gcc >= 10, clang >= 3 and icc >= 21.
9 * In the meantime, to support gcc < 10, we implement __has_builtin
13 #define __has_builtin(x) (0)
18 # define __must_hold(x) __attribute__((context(x,1,1)))
19 # define __acquires(x) __attribute__((context(x,0,1)))
20 # define __releases(x) __attribute__((context(x,1,0)))
21 # define __acquire(x) __context__(x,1)
22 # define __release(x) __context__(x,-1)
23 # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
24 #else /* __CHECKER__ */
26 # define __must_hold(x)
27 # define __acquires(x)
28 # define __releases(x)
29 # define __acquire(x) (void)0
30 # define __release(x) (void)0
31 # define __cond_lock(x,c) (c)
32 #endif /* __CHECKER__ */
34 /* Compiler specific macros. */
36 #include <linux/compiler-gcc.h>
39 #endif /* __LINUX_COMPILER_TYPES_H */