From 2a0911ec8bb64b09c9697a63cf3ea96d78e12e59 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Fri, 6 Mar 2015 15:59:47 +0000 Subject: [PATCH] eal: fix C++11 compilation When compiling C++11-code or above (--std=c++11), the build fails with lots of rte_eth_ctrl.h:517:3: note: in expansion of macro RTE_ALIGN (RTE_ALIGN(RTE_ETH_FLOW_MAX, UINT32_BIT)/UINT32_BIT) ^ When reading the GCC info pages, I get the feeling that __typeof__ is a better choice, and that indeed works when including the headers in C++ files (--std=c++11). Signed-off-by: Simon Kagstrom Signed-off-by: Konstantin Ananyev --- lib/librte_eal/common/include/rte_common.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 8ac940cbc5..4971049767 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -51,6 +51,14 @@ extern "C" { #include #include +#ifndef typeof +#define typeof __typeof__ +#endif + +#ifndef asm +#define asm __asm__ +#endif + /*********** Macros to eliminate unused variable warnings ********/ /** -- 2.20.1