summaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/compiler_attributes.h
blob: 42908bb6c2b56befea5ce89cee4c97febc940c2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Copyright (c) 2010 Isilon Systems, Inc.
 * Copyright (c) 2010 iX Systems, Inc.
 * Copyright (c) 2010 Panasas, Inc.
 * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
 * Copyright (c) 2015 François Tigeot
 * All rights reserved.
 */

#ifndef	_LINUXKPI_LINUX_COMPILER_ATTRIBUTES_H_
#define	_LINUXKPI_LINUX_COMPILER_ATTRIBUTES_H_

#include <sys/cdefs.h>

#define	__attribute_const__		__attribute__((__const__))

#ifndef	__deprecated
#define	__deprecated
#endif

#define	fallthrough			/* FALLTHROUGH */ do { } while(0)

#undef	__always_inline
#define	__always_inline			inline

#define	__printf(a,b)			__printflike(a,b)

#define	__malloc

#define	noinline			__noinline

#if __has_attribute(__nonstring__)
#define	__nonstring			__attribute__((__nonstring__))
#else
#define	__nonstring
#endif

#define	noinline_for_stack		__noinline

#define	__maybe_unused			__unused
#define	__always_unused			__unused

#define	__must_check			__result_use_check

#define	__weak __weak_symbol

#endif