From: Konstantin Ananyev Date: Fri, 6 Mar 2015 15:59:47 +0000 (+0000) Subject: eal: fix C++11 compilation X-Git-Tag: spdx-start~9470 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2a0911ec8bb64b09c9697a63cf3ea96d78e12e59;p=dpdk.git 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 --- 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 ********/ /**