[v2,1/1] mbuf: fix rte_mbuf_dyn.h inclusion from C++

Message ID 20210107013854.9143-1-ashish.sadanandan@gmail.com (mailing list archive)
State Not Applicable, archived
Delegated to: David Marchand
Headers
Series [v2,1/1] mbuf: fix rte_mbuf_dyn.h inclusion from C++ |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Ashish Sadanandan Jan. 7, 2021, 1:38 a.m. UTC
  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")
Cc: olivier.matz@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Ashish Sadanandan <ashish.sadanandan@gmail.com>
---
v2:
* No functional change
* Add fixes tag with reference to commit that introduced the header
* CC stable@dpdk.org

 lib/librte_mbuf/rte_mbuf_dyn.h | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf_dyn.h b/lib/librte_mbuf/rte_mbuf_dyn.h
index d88e7ba..fc4eee7 100644
--- a/lib/librte_mbuf/rte_mbuf_dyn.h
+++ b/lib/librte_mbuf/rte_mbuf_dyn.h
@@ -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_ */