]> git.droids-corp.org - dpdk.git/commitdiff
eal: add missing C++ guards
authorBrian Dooley <brian.dooley@intel.com>
Wed, 16 Feb 2022 15:14:46 +0000 (15:14 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 22 Feb 2022 13:47:49 +0000 (14:47 +0100)
Some public header files were missing 'extern "C"' C++ guards,
and couldn't be used by C++ applications. Add the missing guards.

Fixes: af75078fece3 ("first public release")
Fixes: 7f3aa0863903 ("eal: introduce bit operations API")
Fixes: 166a743c53fa ("compat: add infrastructure to support symbol versioning")
Fixes: 8f40ee0734c8 ("eal/x86: get hypervisor name")
Fixes: 75583b0d1efd ("eal: add keep alive monitoring")
Fixes: 88701645c98c ("eal: move interrupt type out of igb_uio")
Fixes: f04519d8092e ("lib: add missing include dependencies")
Fixes: f58880682c81 ("trace: implement register API")
Fixes: 428eb983f5f7 ("eal: add OS specific header file")
Cc: stable@dpdk.org
Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
lib/eal/include/rte_bitops.h
lib/eal/include/rte_branch_prediction.h
lib/eal/include/rte_compat.h
lib/eal/include/rte_hypervisor.h
lib/eal/include/rte_keepalive.h
lib/eal/include/rte_pci_dev_feature_defs.h
lib/eal/include/rte_pci_dev_features.h
lib/eal/include/rte_time.h
lib/eal/include/rte_trace_point_register.h
lib/eal/linux/include/rte_os.h

index 141e8ea7305cfcb69c687bf50b9244f9b1ed0036..f50dbe43880ccd5fb45e5545aa06183afc396b0e 100644 (file)
 #include <rte_debug.h>
 #include <rte_compat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Get the uint64_t value for a specified bit set.
  *
@@ -271,4 +275,8 @@ rte_bit_relaxed_test_and_clear64(unsigned int nr, volatile uint64_t *addr)
        return val & mask;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_BITOPS_H_ */
index 854ef9e5dde248b76beea82f077ce121a21fd847..0256a9de60adb235f8f3d85fc19d75234edb75bd 100644 (file)
 #ifndef _RTE_BRANCH_PREDICTION_H_
 #define _RTE_BRANCH_PREDICTION_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Check if a branch is likely to be taken.
  *
@@ -38,4 +42,8 @@
 #define unlikely(x)    __builtin_expect(!!(x), 0)
 #endif /* unlikely */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_BRANCH_PREDICTION_H_ */
index 9556bbf4d0634457b2afce288e25446610ea77b9..fc9fbaaab2bb6bfef3a47f1b03726f5459af4351 100644 (file)
@@ -6,6 +6,10 @@
 #ifndef _RTE_COMPAT_H_
 #define _RTE_COMPAT_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifndef ALLOW_EXPERIMENTAL_API
 
 #define __rte_experimental \
@@ -46,4 +50,8 @@ __attribute__((section(".text.internal")))
 
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_COMPAT_H_ */
index 5fe719c1d4a00ffa5059ed54ef018a868ea12e99..1666431ce3ded3a79f8a6dddc4abc58b20870189 100644 (file)
@@ -5,6 +5,10 @@
 #ifndef RTE_HYPERVISOR_H
 #define RTE_HYPERVISOR_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @file
  * Hypervisor awareness.
@@ -30,4 +34,8 @@ rte_hypervisor_get(void);
 const char *
 rte_hypervisor_get_name(enum rte_hypervisor id);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* RTE_HYPERVISOR_H */
index bd25508da8d2944b265a3e3ee56ba0860cc698fa..538fb09095ca676c9e003dae34921024ae849f53 100644 (file)
 #ifndef _KEEPALIVE_H_
 #define _KEEPALIVE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <rte_config.h>
 #include <rte_memory.h>
 
@@ -139,4 +143,8 @@ rte_keepalive_register_relay_callback(struct rte_keepalive *keepcfg,
        rte_keepalive_relay_callback_t callback,
        void *data);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _KEEPALIVE_H_ */
index e12c22081f98b98795f5de15cbc466c3a1e3fcd5..c5bb63128695d3381ec15cb4a034b1e1b68d8396 100644 (file)
@@ -5,6 +5,10 @@
 #ifndef _RTE_PCI_DEV_DEFS_H_
 #define _RTE_PCI_DEV_DEFS_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* interrupt mode */
 enum rte_intr_mode {
        RTE_INTR_MODE_NONE = 0,
@@ -13,4 +17,8 @@ enum rte_intr_mode {
        RTE_INTR_MODE_MSIX
 };
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_PCI_DEV_DEFS_H_ */
index 6104123d277c00fbb32a3e17e15d2613ebb6fc15..ee6e10590c14eade82c56a777bf4078cdc3da212 100644 (file)
@@ -5,6 +5,10 @@
 #ifndef _RTE_PCI_DEV_FEATURES_H
 #define _RTE_PCI_DEV_FEATURES_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <rte_pci_dev_feature_defs.h>
 
 #define RTE_INTR_MODE_NONE_NAME "none"
@@ -12,4 +16,8 @@
 #define RTE_INTR_MODE_MSI_NAME "msi"
 #define RTE_INTR_MODE_MSIX_NAME "msix"
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 5ad7c8841a697186edb113887c11246a932d4376..ec25f7b93d4e5757d8b9727644c85bc7d080aae5 100644 (file)
@@ -5,6 +5,10 @@
 #ifndef _RTE_TIME_H_
 #define _RTE_TIME_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 #include <time.h>
 
@@ -98,4 +102,8 @@ rte_ns_to_timespec(uint64_t nsec)
        return ts;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_TIME_H_ */
index 4f5c86552d4ea414b3c46d3948967da878717da3..2e61439940babcb5d2ca4c8c79af9cc07791ee85 100644 (file)
@@ -5,6 +5,10 @@
 #ifndef _RTE_TRACE_POINT_REGISTER_H_
 #define _RTE_TRACE_POINT_REGISTER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef _RTE_TRACE_POINT_H_
 #error for registration, include this file first before <rte_trace_point.h>
 #endif
@@ -42,4 +46,8 @@ do { \
                RTE_STR(in)"[32]", "string_bounded_t"); \
 } while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_TRACE_POINT_REGISTER_H_ */
index 35c07c70cbf0ac3266278db86937cba0b1951623..c72bf5b7e61b3ad4ee67cc76e5041bd7c9ffd748 100644 (file)
@@ -5,6 +5,10 @@
 #ifndef _RTE_OS_H_
 #define _RTE_OS_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * This header should contain any definition
  * which is not supported natively or named differently in Linux.
@@ -42,4 +46,8 @@ typedef cpu_set_t rte_cpuset_t;
 } while (0)
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_OS_H_ */