[PATCH 1/1] eal: add C++ include guard in generic/rte_vect.h

Thomas Monjalon thomas at monjalon.net
Fri Feb 2 10:18:23 CET 2024


02/02/2024 06:13, Ashish Sadanandan:
> The header was missing the extern "C" directive which causes name
> mangling of functions by C++ compilers, leading to linker errors
> complaining of undefined references to these functions.
> 
> Fixes: 86c743cf9140 ("eal: define generic vector types")
> Cc: nelio.laranjeiro at 6wind.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Ashish Sadanandan <ashish.sadanandan at gmail.com>

Thank you for improving C++ compatibility.

I'm not sure what is best to fix it.
You are adding extern "C" in a file which is not directly included
by the user app. The same was done for rte_rwlock.h.
The other way is to make sure this include is in an extern "C" block
in lib/eal/*/include/rte_vect.h (instead of being before the block).

I would like we use the same approach for all files.
Opinions?




More information about the stable mailing list