Skip to contentSkip to conversation

mbuf: fix rte_mbuf_dyn.h inclusion from C++

PATCH Applied Ashish Sadanandan 3 participants 3 messages Jan 7, 2021 – Jan 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mbuf: fix rte_mbuf_dyn.h inclusion from C++

The header was missing the extern "C" directive which causes name mangling of functions by C++ compilers, leading to linker errors complaining of undefined references to these functions.

Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")
Change-Id I9a92ada0278ff8455cc2718f8231597b0a7c6b48

---

v2:
* No functional change
* Add fixes tag with reference to commit that introduced the header
* CC [email protected]

 lib/librte_mbuf/rte_mbuf_dyn.h | 9 +++++++++
 1 file changed, 9 insertions(+)
lib/librte_mbuf/rte_mbuf_dyn.h +9 -0
index d88e7ba..fc4eee7 100644
@@ -67,6 +67,11 @@
  */
 
 #include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Maximum length of the dynamic field or flag string.
  */
@@ -326,4 +331,8 @@ int rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag);
 __rte_experimental
 int rte_mbuf_dyn_tx_timestamp_register(int *field_offset, uint64_t *tx_flag);
 
+#ifdef __cplusplus
+}
 #endif
+
+#endif /* _RTE_MBUF_DYN_H_ */
Signature · 1 line
2.9.3
Acked-by on v2 1/1
#1 lore raw
Quoted 9 lines · Ashish Sadanandan

The header was missing the extern "C" directive which causes name mangling of functions by C++ compilers, leading to linker errors complaining of undefined references to these functions.

Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")

Change-Id: I9a92ada0278ff8455cc2718f8231597b0a7c6b48

I think this line can be dropped (it comes from gerrit). David, can you do it when pushing the patch?

Quoted 1 line

Thanks!

#2 lore raw
Quoted 11 lines · Olivier Matz
Quoted 8 lines · Ashish Sadanandan

The header was missing the extern "C" directive which causes name mangling of functions by C++ compilers, leading to linker errors complaining of undefined references to these functions.

Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")

Applied, thanks.

Signature · 1 line
David Marchand