[v11,13/16] eal: do not define typeof macro when building with MSVC

Message ID 1691781658-32520-14-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series msvc integration changes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff Aug. 11, 2023, 7:20 p.m. UTC
  When building with MSVC do not assume typeof is a macro and don't
define a typeof macro that conflicts with C23 typeof keyword.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 lib/eal/include/rte_common.h | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h
index b087532..cf7d8d8 100644
--- a/lib/eal/include/rte_common.h
+++ b/lib/eal/include/rte_common.h
@@ -24,9 +24,11 @@ 
 /* OS specific include */
 #include <rte_os.h>
 
+#ifndef RTE_TOOLCHAIN_MSVC
 #ifndef typeof
 #define typeof __typeof__
 #endif
+#endif
 
 #ifndef __cplusplus
 #ifndef asm