diff options
-rw-r--r-- | thunk.h | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -36,7 +36,7 @@ struct thunk_t { /* Macros for declaring the thunk environment struct members, we need a variant * for each supported arity. */ -#define _THUNK_GEN_STRUCT_0() +#define _THUNK_GEN_STRUCT_0(_nil) #define _THUNK_GEN_STRUCT_2(_t_a, _n_a) \ _t_a _n_a; @@ -125,7 +125,7 @@ struct thunk_t { /* Macros for populating the thunk environment struct members when instantiating the * thunk, we need a variant for each supported arity. */ -#define _THUNK_GEN_INSTANTIATE_0(_env) +#define _THUNK_GEN_INSTANTIATE_0(_env, _nil) #define _THUNK_GEN_INSTANTIATE_2(_env, _t_a, _n_a) \ _env->_n_a = _n_a; @@ -214,7 +214,8 @@ struct thunk_t { /* Macros for dispatching the embedded thunk from its associated environment, * we need a variant for each supported arity. */ -#define _THUNK_GEN_DISPATCH_0(_name, _env) +#define _THUNK_GEN_DISPATCH_0(_name, _env, _nil) \ + _name() #define _THUNK_GEN_DISPATCH_2(_name, _env, _t_a, _n_a) \ _name(_env->_n_a) @@ -258,7 +259,8 @@ struct thunk_t { /* Macros for prototyping the function being thunked, * we need a variant for each supported arity. */ -#define _THUNK_GEN_PROTO_0(_name) +#define _THUNK_GEN_PROTO_0(_name, _nil) \ + _name(void) #define _THUNK_GEN_PROTO_2(_name, _t_a, _n_a) \ _name(_t_a _n_a) |