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 <roretzla@linux.microsoft.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
This commit is contained in:
Tyler Retzlaff 2021-03-23 21:26:51 -07:00 committed by Thomas Monjalon
parent ff43cd79e3
commit 7498c2d74e

View File

@ -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