DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] cpp: Fix missing extern "C" closing bracket
@ 2025-06-24 11:12 Edvard Fagerholm
  2025-06-24 13:52 ` Bruce Richardson
  2025-06-24 19:58 ` [PATCH v2] " Edvard Fagerholm
  0 siblings, 2 replies; 4+ messages in thread
From: Edvard Fagerholm @ 2025-06-24 11:12 UTC (permalink / raw)
  To: dev; +Cc: Edvard Fagerholm, Bruce Richardson, Konstantin Ananyev

RTE_FORCE_INTRINSICS with a C++ compiler causes rte_atomic.h and
rte_byteorder.h to emit on x86 an extern "C" without a closing
brace.
---
 lib/eal/x86/include/rte_atomic.h    | 4 ++--
 lib/eal/x86/include/rte_byteorder.h | 9 +++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/eal/x86/include/rte_atomic.h b/lib/eal/x86/include/rte_atomic.h
index c72c47c83e..68629016b4 100644
--- a/lib/eal/x86/include/rte_atomic.h
+++ b/lib/eal/x86/include/rte_atomic.h
@@ -282,10 +282,10 @@ static inline int rte_atomic32_dec_and_test(rte_atomic32_t *v)
 	return ret != 0;
 }
 
-#ifdef __cplusplus
-}
 #endif
 
+#ifdef __cplusplus
+}
 #endif
 
 #ifdef RTE_ARCH_I686
diff --git a/lib/eal/x86/include/rte_byteorder.h b/lib/eal/x86/include/rte_byteorder.h
index 5a49ffcd50..62a87c1aa6 100644
--- a/lib/eal/x86/include/rte_byteorder.h
+++ b/lib/eal/x86/include/rte_byteorder.h
@@ -48,10 +48,6 @@ static inline uint32_t rte_arch_bswap32(uint32_t _x)
 	return x;
 }
 
-#ifdef __cplusplus
-}
-#endif
-
 #define rte_bswap16(x) ((uint16_t)(__builtin_constant_p(x) ?		\
 				   rte_constant_bswap16(x) :		\
 				   rte_arch_bswap16(x)))
@@ -69,6 +65,11 @@ static inline uint32_t rte_arch_bswap32(uint32_t _x)
 #else
 #include "rte_byteorder_64.h"
 #endif
+
+#endif
+
+#ifdef __cplusplus
+}
 #endif
 
 #define rte_cpu_to_le_16(x) (x)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-24 19:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-24 11:12 [PATCH] cpp: Fix missing extern "C" closing bracket Edvard Fagerholm
2025-06-24 13:52 ` Bruce Richardson
2025-06-24 14:17   ` Edvard Fagerholm
2025-06-24 19:58 ` [PATCH v2] " Edvard Fagerholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).