summaryrefslogtreecommitdiff
path: root/thunk.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-11-04 02:38:17 -0800
committerVito Caputo <vcaputo@pengaru.com>2020-11-04 02:38:17 -0800
commit9274a3718da767a644df883e6a2ea1e58e060180 (patch)
tree327cb53938b38dcfbdf205e1ede7906f7270f3d9 /thunk.h
parent214297a0a6ed78dc6f1ab0ce10dc146b57fa903e (diff)
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));
Diffstat (limited to 'thunk.h')
-rw-r--r--thunk.h5
1 files changed, 4 insertions, 1 deletions
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) {
© 2021 All Rights Reserved