X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Finclude%2Frte_compat.h;h=2718612cce73fa905509bb42242ec19b67653895;hb=8d63961fc7137cab823f85a50ee82779792f21e4;hp=4cd8f68d68f15c252caf411b3cbb2ef3bf740ec2;hpb=fba5af82adc8aad741e206161800fcb94a133ab7;p=dpdk.git diff --git a/lib/librte_eal/include/rte_compat.h b/lib/librte_eal/include/rte_compat.h index 4cd8f68d68..2718612cce 100644 --- 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 -#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"))) +#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 \