[PATCH v5 02/27] eal/common: add token concatenation macro
Bruce Richardson
bruce.richardson at intel.com
Wed May 27 14:38:38 CEST 2026
On Mon, May 25, 2026 at 03:06:21PM +0100, Anatoly Burakov wrote:
> Add `RTE_CONCAT()` macro to enable token concatenation with proper macro
> expansion.
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
> lib/eal/include/rte_common.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h
> index 0a356abae2..05e72e500e 100644
> --- a/lib/eal/include/rte_common.h
> +++ b/lib/eal/include/rte_common.h
> @@ -918,6 +918,10 @@ __extension__ typedef uint64_t RTE_MARKER64[0];
> /** Take a macro value and get a string version of it */
> #define RTE_STR(x) _RTE_STR(x)
>
> +/** Concatenate two tokens after expanding macros in both. */
> +#define _RTE_CONCAT2(a, b) a ## b
> +#define RTE_CONCAT(a, b) _RTE_CONCAT2(a, b)
> +
> /**
> * ISO C helpers to modify format strings using variadic macros.
> * This is a replacement for the ", ## __VA_ARGS__" GNU extension.
> --
> 2.47.3
>
More information about the dev
mailing list