eal: declare extern "C" link when building with __cplusplus

Message ID 1615959198-22128-1-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series eal: declare extern "C" link when building with __cplusplus |

Checks

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

Commit Message

Tyler Retzlaff March 17, 2021, 5:33 a.m. UTC
  Add missing extern "C" linkage for rte_reciprocal.h consistent with
other eal headers.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/librte_eal/include/rte_reciprocal.h | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Stephen Hemminger March 17, 2021, 5:59 a.m. UTC | #1
On Tue, 16 Mar 2021 22:33:18 -0700
Tyler Retzlaff <roretzla@linux.microsoft.com> wrote:

> Add missing extern "C" linkage for rte_reciprocal.h consistent with
> other eal headers.
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

Looks good all exported headers should have this

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
Dmitry Kozlyuk March 17, 2021, 7:29 a.m. UTC | #2
2021-03-16 22:33 (UTC-0700), Tyler Retzlaff:
> Add missing extern "C" linkage for rte_reciprocal.h consistent with
> other eal headers.
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
>  lib/librte_eal/include/rte_reciprocal.h | 8 ++++++++
>  1 file changed, 8 insertions(+)

This is worth backporting:

	Fixes: ffe3ec811ef5 ("sched: introduce reciprocal divide")
	Cc: stable@dpdk.org
  

Patch

diff --git a/lib/librte_eal/include/rte_reciprocal.h b/lib/librte_eal/include/rte_reciprocal.h
index 735adb029..fa1cb4854 100644
--- a/lib/librte_eal/include/rte_reciprocal.h
+++ b/lib/librte_eal/include/rte_reciprocal.h
@@ -29,6 +29,10 @@ 
 
 #include <rte_common.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct rte_reciprocal {
 	uint32_t m;
 	uint8_t sh1, sh2;
@@ -89,4 +93,8 @@  rte_reciprocal_divide_u64(uint64_t a, const struct rte_reciprocal_u64 *R)
 struct rte_reciprocal rte_reciprocal_value(uint32_t d);
 struct rte_reciprocal_u64 rte_reciprocal_value_u64(uint64_t d);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_RECIPROCAL_H_ */