From fb45131fad61bd6b3b6d48e545cea5fee61ee691 Mon Sep 17 00:00:00 2001 From: Michalis Pappas Date: Tue, 15 Oct 2024 11:11:39 +0200 Subject: [PATCH] lib/uklibparam: Namespace symbols to avoid conflicts Namespace the `__uk_libparam_param` and `__uk_libparam_pdata` symbols exported by each library to avoid conflicts when two libraries export a parameter with the same name. Signed-off-by: Michalis Pappas Approved-by: Simon Kuenzer Reviewed-by: Simon Kuenzer Reviewed-by: Razvan Deaconescu GitHub-Closes: #1526 --- lib/uklibparam/include/uk/libparam.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/uklibparam/include/uk/libparam.h b/lib/uklibparam/include/uk/libparam.h index 4111f8ce0..c0dca15cf 100644 --- a/lib/uklibparam/include/uk/libparam.h +++ b/lib/uklibparam/include/uk/libparam.h @@ -66,8 +66,16 @@ extern C { * A library parameter descriptor (struct uk_libparam_desc) is referencing to * the section's base address for iteration. */ -#define UK_LIBPARAM_PARAM_NAMEPREFIX __uk_libparam_param_ -#define UK_LIBPARAM_PDATA_NAMEPREFIX __uk_libparam_pdata_ +#define _UK_LIBPARAM_PARAM_NAMEPREFIX __uk_libparam_param_ +#define UK_LIBPARAM_PARAM_NAMEPREFIX \ + UK_LIBPARAM_CONCAT(UK_LIBPARAM_CONCAT(_UK_LIBPARAM_PARAM_NAMEPREFIX,\ + UK_LIBPARAM_LIBPREFIX), _) + +#define _UK_LIBPARAM_PDATA_NAMEPREFIX \ + __uk_libparam_pdata_ +#define UK_LIBPARAM_PDATA_NAMEPREFIX \ + UK_LIBPARAM_CONCAT(UK_LIBPARAM_CONCAT(_UK_LIBPARAM_PDATA_NAMEPREFIX,\ + UK_LIBPARAM_LIBPREFIX), _) #define UK_LIBPARAM_PARAMSECTION_NAME uk_libparam_params #define UK_LIBPARAM_PARAMSECTION_STARTSYM \ -- 2.39.5