From a42b854f1413ac3f750758c492fbf0674cff7719 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Thu, 7 Jan 2021 22:12:40 +0100 Subject: [PATCH] Add macro string_cats to concat multiple strings --- m-string.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/m-string.h b/m-string.h index aad40c70..074ad311 100644 --- a/m-string.h +++ b/m-string.h @@ -1848,6 +1848,10 @@ namespace m_string { #define string_strim(...) \ M_APPLY(string_strim, M_IF_DEFAULT1(" \n\r\t", __VA_ARGS__)) +/* Concat a set strings (or const char * if C1)) into one string */ +#define string_cats(a, ...) \ + M_MAP2_C(string_cat, a, __VA_ARGS__) + /* Macro encapsulation for C11 */ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L