From 5690c0ed3dba4170d4156568b100f633a07ec285 Mon Sep 17 00:00:00 2001 From: Pavel Vlasov Date: Wed, 27 Nov 2024 10:52:57 +0300 Subject: [PATCH] Fix for C++ compilation inside of forced C extern headers If upper level API is defined as extern C on upper level and uses this header underneath it fails to compile in C++ app --- lib/eal/include/rte_bitops.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/eal/include/rte_bitops.h b/lib/eal/include/rte_bitops.h index deb1fd43f25..870665f05c9 100644 --- a/lib/eal/include/rte_bitops.h +++ b/lib/eal/include/rte_bitops.h @@ -1341,6 +1341,7 @@ rte_log2_u64(uint64_t v) #ifdef __cplusplus } +extern "C++" { /* * Since C++ doesn't support generic selection (i.e., _Generic), * function overloading is used instead. Such functions must be @@ -1502,7 +1503,7 @@ __RTE_BIT_OVERLOAD_3R(atomic_, test_and_clear,, bool, unsigned int, nr, int, mem __RTE_BIT_OVERLOAD_4R(atomic_, test_and_assign,, bool, unsigned int, nr, bool, value, int, memory_order) #endif - +} #endif #endif /* _RTE_BITOPS_H_ */