From 9274a3718da767a644df883e6a2ea1e58e060180 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 4 Nov 2020 02:38:17 -0800 Subject: thunk: double up THUNK() macro this is necessary for nested THUNK() constructions, e.g.: thunk_t * closure = THUNK(a, b, c, THUNK(d, e, f)); --- thunk.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/thunk.h b/thunk.h index e4e4a08..dd80e84 100644 --- a/thunk.h +++ b/thunk.h @@ -416,9 +416,12 @@ struct thunk_t { /* Call the appropriate instantiate function which returns an embedded thunk_t, * this is how you prepare the thunks established via THUNK_DEFINE(). */ -#define THUNK(_call) \ +#define _THUNK(_call) \ __thunk_instantiate_##_call +#define THUNK(_call) \ + _THUNK(_call) + /* Call the function associated with a prepared thunk, supplying the bound environment * as arguments. This is how code receiving generic thunks executes them. */ static inline int thunk_dispatch(thunk_t *thunk) { -- cgit v1.2.3