1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
3 * wrapper/compiler_attributes.h
5 * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
8 #ifndef _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H
9 #define _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H
11 #include <lttng-kernel-version.h>
13 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0))
14 #include <linux/compiler_attributes.h>
17 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0))
20 * Use the kernel provided fallthrough attribute macro.
22 #define lttng_fallthrough fallthrough
24 #else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) */
27 * Fallback to the comment for kernels pre 5.15 that don't build with
28 * '-Wimplicit-fallthrough=5'.
30 #define lttng_fallthrough do {} while (0) /* fallthrough */
32 #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0) */
34 #endif /* _LTTNG_WRAPPER_COMPILER_ATTRIBUTES_H */
This page took 0.031162 seconds and 4 git commands to generate.