[PATCH v5 01/22] eal: provide macro to expand marker extensions
Tyler Retzlaff
roretzla at linux.microsoft.com
Sat Feb 24 09:21:46 CET 2024
RTE_MARKER typedefs are a GCC extension unsupported by MSVC. Provide a
new macro __rte_marker(type, name) that may be used to expand RTE_MARKER
empty in struct definitions when building with MSVC.
Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
lib/eal/include/rte_common.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h
index 1cc1222..60d81a2 100644
--- a/lib/eal/include/rte_common.h
+++ b/lib/eal/include/rte_common.h
@@ -578,7 +578,11 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
/*********** Structure alignment markers ********/
-#ifndef RTE_TOOLCHAIN_MSVC
+#ifdef RTE_TOOLCHAIN_MSVC
+
+#define __rte_marker(type, name)
+
+#else
/** Generic marker for any place in a structure. */
__extension__ typedef void *RTE_MARKER[0];
@@ -591,6 +595,8 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
/** Marker for 8B alignment in a structure. */
__extension__ typedef uint64_t RTE_MARKER64[0];
+#define __rte_marker(type, name) type name;
+
#endif
/*********** Macros for calculating min and max **********/
--
1.8.3.1
More information about the dev
mailing list