[PATCH] eal: fix msvc conditional compile of rte atomic thread fence

Tyler Retzlaff roretzla at linux.microsoft.com
Tue Nov 7 21:00:16 CET 2023


MSVC does not expose legacy atomics. When the legacy atomics were
excluded rte_atomic_thread_fence was also unintentionally excluded

Adjust the conditional compilation check to expose
rte_atomic_thread_fence.

Fixes: 27da6a123414 ("eal: hide legacy atomics API for MSVC")

Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
 lib/eal/x86/include/rte_atomic.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eal/x86/include/rte_atomic.h b/lib/eal/x86/include/rte_atomic.h
index f754423..74b1b24 100644
--- a/lib/eal/x86/include/rte_atomic.h
+++ b/lib/eal/x86/include/rte_atomic.h
@@ -83,8 +83,6 @@
 
 #define rte_io_rmb() rte_compiler_barrier()
 
-#ifndef RTE_TOOLCHAIN_MSVC
-
 /**
  * Synchronization fence between threads based on the specified memory order.
  *
@@ -101,6 +99,8 @@
 		__rte_atomic_thread_fence(memorder);
 }
 
+#ifndef RTE_TOOLCHAIN_MSVC
+
 /*------------------------- 16 bit atomic operations -------------------------*/
 
 #ifndef RTE_FORCE_INTRINSICS
-- 
1.8.3.1



More information about the dev mailing list