git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vfio: fix API description
[dpdk.git]
/
lib
/
librte_eal
/
include
/
rte_compat.h
diff --git
a/lib/librte_eal/include/rte_compat.h
b/lib/librte_eal/include/rte_compat.h
index
4cd8f68
..
2718612
100644
(file)
--- a/
lib/librte_eal/include/rte_compat.h
+++ b/
lib/librte_eal/include/rte_compat.h
@@
-19,12
+19,23
@@
__attribute__((section(".text.experimental")))
#endif
#endif
-#ifndef ALLOW_INTERNAL_API
+#ifndef __has_attribute
+/* if no has_attribute assume no support for attribute too */
+#define __has_attribute(x) 0
+#endif
+
+#if !defined ALLOW_INTERNAL_API && __has_attribute(error) /* For GCC */
#define __rte_internal \
__attribute__((error("Symbol is not public ABI"), \
section(".text.internal")))
#define __rte_internal \
__attribute__((error("Symbol is not public ABI"), \
section(".text.internal")))
+#elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */
+
+#define __rte_internal \
+__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
+section(".text.internal")))
+
#else
#define __rte_internal \
#else
#define __rte_internal \