eal: fix compiler detection in public headers
authorThomas Monjalon <thomas@monjalon.net>
Mon, 16 Mar 2020 12:04:53 +0000 (13:04 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 17 Mar 2020 23:59:17 +0000 (00:59 +0100)
commit0c9a5735a9479e8b6c05580efdbd15ae00869edf
treedb3da75d225be9c79e184cf2fdb501e30c49876f
parent61669ecb921fff821db11d81557fa0449a7eb79c
eal: fix compiler detection in public headers

RTE_TOOLCHAIN_* macros are defining the target compiler.
Some API may be used in a host application like pmdinfogen.
That's why the the public headers should check the effective compiler
in use instead of the target compiler.

Detecting the compiler with macros is easy, except for __GNUC__
which is defined in all compilers supporting some GNU compatibility.

It is improved by defining RTE_CC_CLANG, RTE_CC_ICC and RTE_CC_GCC.
The extra macro RTE_CC_IS_GNU is defined to 0 or 1 in GCC case,
so it can be used simply with #if.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
lib/librte_eal/common/include/arch/arm/rte_vect.h
lib/librte_eal/common/include/rte_common.h
lib/librte_table/rte_lru_x86.h