diff --git a/m-core.h b/m-core.h index 0300db3e..fd22b0db 100644 --- a/m-core.h +++ b/m-core.h @@ -221,6 +221,15 @@ #define M_PARENTHESISI_DETECT(...) 0, 1, #define M_PARENTHESIS_P(x) M_RET_ARG2(M_PARENTHESISI_DETECT x, 0, useless) +/* Concat a and b like M_C but + do not do it if either a or b is a parenthesis + Example: + M_SAFE_C(aaa,bbb) --> aaabbb + M_SAFE_C((a), b) --> (a) b +*/ +#define M_SAFE_C(a,b) \ + M_IF(M_OR(M_PARENTHESIS_P(a), M_PARENTHESIS_P(b)))(a b, M_C(a,b)) + /* Necessary macros to handle recursivity */ /* Delay the evaluation by one level or two or three or ... */ /* The argument is a macro-function which has to be deferred */