From 7498c2d74ee9d81f2e4f75dcce8390fdf9c800da Mon Sep 17 00:00:00 2001 From: Tyler Retzlaff Date: Tue, 23 Mar 2021 21:26:51 -0700 Subject: [PATCH] eal: do not redefine asm keyword in C++ C++ forbids redefining a keyword as a macro. The keyword asm is conditionally-supported and implementation defined, but it seems our best guess. In C, if asm does not exist, it is defined as __asm__ which is a GNU extension. Signed-off-by: Tyler Retzlaff Signed-off-by: Thomas Monjalon --- lib/librte_eal/include/rte_common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h index 1b630baf16..d5a32c66a5 100644 --- a/lib/librte_eal/include/rte_common.h +++ b/lib/librte_eal/include/rte_common.h @@ -31,9 +31,11 @@ extern "C" { #define typeof __typeof__ #endif +#ifndef __cplusplus #ifndef asm #define asm __asm__ #endif +#endif /** C extension macro for environments lacking C11 features. */ #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L -- 2.20.1