[PATCH v2] cpp: Fix missing extern "C" closing bracket
Edvard Fagerholm
edvard.fagerholm at gmail.com
Tue Jun 24 21:58:10 CEST 2025
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.
Signed-off-by: Edvard Fagerholm <edvard.fagerholm at gmail.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
lib/eal/x86/include/rte_atomic.h | 6 +++---
lib/eal/x86/include/rte_byteorder.h | 9 +++++----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/lib/eal/x86/include/rte_atomic.h b/lib/eal/x86/include/rte_atomic.h
index c72c47c83e..7ba1722683 100644
--- a/lib/eal/x86/include/rte_atomic.h
+++ b/lib/eal/x86/include/rte_atomic.h
@@ -282,18 +282,18 @@ static inline int rte_atomic32_dec_and_test(rte_atomic32_t *v)
return ret != 0;
}
+#endif /* RTE_FORCE_INTRINSICS */
+
#ifdef __cplusplus
}
#endif
-#endif
-
#ifdef RTE_ARCH_I686
#include "rte_atomic_32.h"
#else
#include "rte_atomic_64.h"
#endif
-#endif
+#endif /* RTE_TOOLCHAIN_MSVC */
#endif /* _RTE_ATOMIC_X86_H_ */
diff --git a/lib/eal/x86/include/rte_byteorder.h b/lib/eal/x86/include/rte_byteorder.h
index 5a49ffcd50..f54bb07cd0 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 /* RTE_FORCE_INTRINSICS */
+
+#ifdef __cplusplus
+}
#endif
#define rte_cpu_to_le_16(x) (x)
--
2.34.1
More information about the dev
mailing list