[3/3] rib: add C++ include guard
diff mbox series

Message ID 20200625203208.19315-4-stephen@networkplumber.org
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series
  • rib: minor fixes
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger June 25, 2020, 8:32 p.m. UTC
All include files should be safe from C++

Fixes: 5a5793a5ffa2 ("rib: add RIB library")
Fixes: f7e861e21c46 ("rib: support IPv6")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_rib/rte_rib.h  |  8 ++++++++
 lib/librte_rib/rte_rib6.h | 10 +++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

Comments

Medvedkin, Vladimir June 26, 2020, 2:04 p.m. UTC | #1
On 25/06/2020 21:32, Stephen Hemminger wrote:
> All include files should be safe from C++
>
> Fixes: 5a5793a5ffa2 ("rib: add RIB library")
> Fixes: f7e861e21c46 ("rib: support IPv6")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>   lib/librte_rib/rte_rib.h  |  8 ++++++++
>   lib/librte_rib/rte_rib6.h | 10 +++++++++-
>   2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_rib/rte_rib.h b/lib/librte_rib/rte_rib.h
> index a7daa9d8a76e..e9ffefce6edd 100644
> --- a/lib/librte_rib/rte_rib.h
> +++ b/lib/librte_rib/rte_rib.h
> @@ -13,6 +13,10 @@
>   
>   #include <rte_compat.h>
>   
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
>   /**
>    * rte_rib_get_nxt() flags
>    */
> @@ -275,4 +279,8 @@ __rte_experimental
>   void
>   rte_rib_free(struct rte_rib *rib);
>   
> +#ifdef __cplusplus
> +}
> +#endif
> +
>   #endif /* _RTE_RIB_H_ */
> diff --git a/lib/librte_rib/rte_rib6.h b/lib/librte_rib/rte_rib6.h
> index e6b4b7fff98c..68eaa8aa4812 100644
> --- a/lib/librte_rib/rte_rib6.h
> +++ b/lib/librte_rib/rte_rib6.h
> @@ -14,6 +14,10 @@
>   #include <rte_memcpy.h>
>   #include <rte_compat.h>
>   
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
>   #define RTE_RIB6_IPV6_ADDR_SIZE	16
>   
>   /**
> @@ -332,4 +336,8 @@ __rte_experimental
>   void
>   rte_rib6_free(struct rte_rib6 *rib);
>   
> -#endif /* _RTE_RIB_H_ */
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* _RTE_RIB6_H_ */

Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

Patch
diff mbox series

diff --git a/lib/librte_rib/rte_rib.h b/lib/librte_rib/rte_rib.h
index a7daa9d8a76e..e9ffefce6edd 100644
--- a/lib/librte_rib/rte_rib.h
+++ b/lib/librte_rib/rte_rib.h
@@ -13,6 +13,10 @@ 
 
 #include <rte_compat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * rte_rib_get_nxt() flags
  */
@@ -275,4 +279,8 @@  __rte_experimental
 void
 rte_rib_free(struct rte_rib *rib);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_RIB_H_ */
diff --git a/lib/librte_rib/rte_rib6.h b/lib/librte_rib/rte_rib6.h
index e6b4b7fff98c..68eaa8aa4812 100644
--- a/lib/librte_rib/rte_rib6.h
+++ b/lib/librte_rib/rte_rib6.h
@@ -14,6 +14,10 @@ 
 #include <rte_memcpy.h>
 #include <rte_compat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define RTE_RIB6_IPV6_ADDR_SIZE	16
 
 /**
@@ -332,4 +336,8 @@  __rte_experimental
 void
 rte_rib6_free(struct rte_rib6 *rib);
 
-#endif /* _RTE_RIB_H_ */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_RIB6_H_ */