DPDK  20.11.3
rte_compat.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2015 Neil Horman <nhorman@tuxdriver.com>.
3  * All rights reserved.
4  */
5 
6 #ifndef _RTE_COMPAT_H_
7 #define _RTE_COMPAT_H_
8 
9 #ifndef ALLOW_EXPERIMENTAL_API
10 
11 #define __rte_experimental \
12 __attribute__((deprecated("Symbol is not yet part of stable ABI"), \
13 section(".text.experimental")))
14 
15 #else
16 
17 #define __rte_experimental \
18 __attribute__((section(".text.experimental")))
19 
20 #endif
21 
22 #ifndef __has_attribute
23 /* if no has_attribute assume no support for attribute too */
24 #define __has_attribute(x) 0
25 #endif
26 
27 #if !defined ALLOW_INTERNAL_API && __has_attribute(error) /* For GCC */
28 
29 #define __rte_internal \
30 __attribute__((error("Symbol is not public ABI"), \
31 section(".text.internal")))
32 
33 #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */
34 
35 #define __rte_internal \
36 __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
37 section(".text.internal")))
38 
39 #else
40 
41 #define __rte_internal \
42 __attribute__((section(".text.internal")))
43 
44 #endif
45 
46 #endif /* _RTE_COMPAT_H_ */