summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-11-04thunk: double up THUNK() macroVito Caputo
this is necessary for nested THUNK() constructions, e.g.: thunk_t * closure = THUNK(a, b, c, THUNK(d, e, f));
2020-11-04thunk: s/_THUNK_GEN_INSTANTIATE/_THUNK_GEN_INITIALIZE/Vito Caputo
this internal macro just generates the initializer, just switching to a more accurate name.
2020-11-04thunk: expand max number of thunk parameters to 12Vito Caputo
Just bumping this limit a bit
2020-11-04thunk: switch from pragma to classical header guardVito Caputo
Pragma isn't standardized and it didn't seem to be working properly in a project where simply replacing it with this commit fixed compilation
2018-12-11thunk: fixup handling arity=0 thunksVito Caputo
Overlooked this, but it's also odd how the __VA_ARGS__ when empty is still being passed as a separate argument requiring the addition of the _nil placeholders.
2018-05-17thunk: default to static for everythingVito Caputo
If there comes a time when this is an issue, selector may be added and a separate declaration macro provided. For now, it appears static use is generally the appropriate thing to do.
2016-06-04thunk: initial commitVito Caputo
Something I slapped together in the interests of mechanizing the creation of thunks in C. In this context a thunk is simply a helper function that serves to normalize the calling convention of functions having potentially varying arity. This code has not been used in anything yet, I just put it together because I anticipate using it soon based on some projects I've been thinking about. example.c contains a trivial usage example.
© All Rights Reserved