[v2,08/11] kni: fix missing C++ guards

Message ID 20220216151456.114242-9-brian.dooley@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Series add missing C++ guards |


Context Check Description
ci/checkpatch success coding style OK

Commit Message

Brian Dooley Feb. 16, 2022, 3:14 p.m. UTC
  Some public header files were missing 'extern "C"' C++ guards,
and couldn't be used by C++ applications. Add the missing guards.

Fixes: 3fc5ca2f6352 ("kni: initial import")
Cc: stable@dpdk.org

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

v2: Added missing apostrophe to commit message.
 lib/kni/rte_kni_common.h | 8 ++++++++
 1 file changed, 8 insertions(+)


diff --git a/lib/kni/rte_kni_common.h b/lib/kni/rte_kni_common.h
index b547ea5501..8d3ee0fa4f 100644
--- a/lib/kni/rte_kni_common.h
+++ b/lib/kni/rte_kni_common.h
@@ -6,6 +6,10 @@ 
 #ifndef _RTE_KNI_COMMON_H_
 #define _RTE_KNI_COMMON_H_
+#ifdef __cplusplus
+extern "C" {
 #ifdef __KERNEL__
 #include <linux/if.h>
 #include <asm/barrier.h>
@@ -136,4 +140,8 @@  struct rte_kni_device_info {
 #define RTE_KNI_IOCTL_CREATE  _IOWR(0, 2, struct rte_kni_device_info)
 #define RTE_KNI_IOCTL_RELEASE _IOWR(0, 3, struct rte_kni_device_info)
+#ifdef __cplusplus
 #endif /* _RTE_KNI_COMMON_H_ */