From 070e8c57d5829e9b429f698c329a6d0b0d4d071c Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 19 Nov 2020 16:49:03 -0800 Subject: thunk: fixup expand max number of thunk parameters to 12 f73822 was supposed to do this, but I messed up expanding the C99_NARGS macro fully. NARGS also needs to support 2X the desired number of parameters as they're supplied in {type, name} pairs. 12 is the maximum number of pairs supported at this time, adding more is trivial when needed. --- thunk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thunk.h b/thunk.h index 262137f..2cd607f 100644 --- a/thunk.h +++ b/thunk.h @@ -33,8 +33,8 @@ struct thunk_t { #define _C99_NARGS(...) \ _C99_NARGS1( , ##__VA_ARGS__) #define _C99_NARGS1(...) \ - _C99_NARGS2(__VA_ARGS__, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) -#define _C99_NARGS2(_, x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, _n, ...) \ + _C99_NARGS2(__VA_ARGS__, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +#define _C99_NARGS2(_, x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, _n, ...) \ _n /* Macros for declaring the thunk environment struct members, we need a variant -- cgit v1.2.3