# HG changeset patch # User William Astle # Date 1643577214 25200 # Node ID 4536f0e61425e8ba512a29938debfaa97e0c343d # Parent 2c4d11da2afee036d12b8b4b57bc0c0185aeed5a Add \# macro expansion which expands to the number of arguments It seems useful to have a number of arguments in some macros. Add \# expansion tag which turns into the number of arguments. diff -r 2c4d11da2afe -r 4536f0e61425 lwasm/macro.c --- a/lwasm/macro.c Sun Jan 30 14:12:40 2022 -0700 +++ b/lwasm/macro.c Sun Jan 30 14:13:34 2022 -0700 @@ -247,6 +247,14 @@ } p2++; } + else if (*p2 == '\\' && p2[1] == '#') + { + char ctcbuf[25]; + snprintf(ctcbuf, 25, "%d", nargs); + for (p3 = ctcbuf; *p3; p3++) + macro_add_to_buff(&linebuff, &bloc, &blen, *p3); + p2++; + } else if (*p2 == '\\' && isdigit(p2[1])) { int n;