[PATCH] eal: provide per lcore macros for MSVC
Tyler Retzlaff
roretzla at linux.microsoft.com
Mon Jul 10 23:29:45 CEST 2023
Provide per lcore macros that use __declspec(thread) and uses C23
typeof.
Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
lib/eal/include/rte_per_lcore.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lib/eal/include/rte_per_lcore.h b/lib/eal/include/rte_per_lcore.h
index eaedf0c..4ef8905 100644
--- a/lib/eal/include/rte_per_lcore.h
+++ b/lib/eal/include/rte_per_lcore.h
@@ -24,6 +24,7 @@
#include <pthread.h>
+#ifndef RTE_TOOLCHAIN_MSVC
/**
* Macro to define a per lcore variable "var" of type "type", don't
* use keywords like "static" or "volatile" in type, just prefix the
@@ -37,6 +38,13 @@
*/
#define RTE_DECLARE_PER_LCORE(type, name) \
extern __thread __typeof__(type) per_lcore_##name
+#else
+#define RTE_DEFINE_PER_LCORE(type, name) \
+ __declspec(thread) typeof(type) per_lcore_##name
+
+#define RTE_DECLARE_PER_LCORE(type, name) \
+ extern __declspec(thread) typeof(type) per_lcore_##name
+#endif
/**
* Read/write the per-lcore variable value
--
1.8.3.1
More information about the dev
mailing list