Skip to contentSkip to conversation

eal: declare extern "C" link when building with __cplusplus

PATCH Superseded Tyler Retzlaff 4 participants 5 messages Mar 17, 2021 – Apr 15, 2021 Broadcom iproc Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: declare extern "C" link when building with __cplusplus

Add missing extern "C" linkage for rte_reciprocal.h consistent with other eal headers.

---
 lib/librte_eal/include/rte_reciprocal.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_eal/include/rte_reciprocal.h +8 -0
index 735adb029..fa1cb4854 100644
@@ -29,6 +29,10 @@
 
 #include <rte_common.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct rte_reciprocal {
 	uint32_t m;
 	uint8_t sh1, sh2;
@@ -89,4 +93,8 @@ rte_reciprocal_divide_u64(uint64_t a, const struct rte_reciprocal_u64 *R)
 struct rte_reciprocal rte_reciprocal_value(uint32_t d);
 struct rte_reciprocal_u64 rte_reciprocal_value_u64(uint64_t d);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_RECIPROCAL_H_ */
Signature · 1 line
2.30.0.vfs.0.2
#3 lore raw

PATCH v2 1/1 eal: declare extern "C" linkage when building with __cplusplus

In reply to Tyler Retzlaff

Add missing extern "C" linkage for rte_reciprocal.h consistent with other eal headers.

Fixes ffe3ec811ef5 ("sched: introduce reciprocal divide")

---

* fixed commit title line link->linkage
* added Fixes and Cc from dmitryk feedback

 lib/librte_eal/include/rte_reciprocal.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_eal/include/rte_reciprocal.h +8 -0
index 735adb029..fa1cb4854 100644
@@ -29,6 +29,10 @@
 
 #include <rte_common.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct rte_reciprocal {
 	uint32_t m;
 	uint8_t sh1, sh2;
@@ -89,4 +93,8 @@ rte_reciprocal_divide_u64(uint64_t a, const struct rte_reciprocal_u64 *R)
 struct rte_reciprocal rte_reciprocal_value(uint32_t d);
 struct rte_reciprocal_u64 rte_reciprocal_value_u64(uint64_t d);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_RECIPROCAL_H_ */
Signature · 1 line
2.30.0.vfs.0.2
Acked-by on v2 1/1 Applied
#4 lore raw

Re: [dpdk-dev] [PATCH v2] eal: declare extern "C" linkage when building with __cplusplus

Quoted 8 lines · Tyler Retzlaff

Add missing extern "C" linkage for rte_reciprocal.h consistent with other eal headers.

Fixes ffe3ec811ef5 ("sched: introduce reciprocal divide")

Applied, thanks.

Signature · 1 line
David Marchand