Add new macro M_SAFE_C

This commit is contained in:
Patrick Pelissier committed 2017-03-31 00:03:02 +02:00
1 parent 88711fae6c
commit 0bfa96e5af
1 file changed
+9
+9
View File
@@ -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 */