diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-05-07 21:22:38 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-01-06 17:19:52 +0200 |
| commit | d501b2c9ebab6f5b90c808ea0e5fde912818707d (patch) | |
| tree | c41f5292d1107ac56c3671860a18717a63730772 /mod/util.c | |
| parent | 49320376a1ba3fcc7eba7ceda2c728649ee8323e (diff) | |
| download | fwd-d501b2c9ebab6f5b90c808ea0e5fde912818707d.tar.gz fwd-d501b2c9ebab6f5b90c808ea0e5fde912818707d.zip | |
implement enough type analysis for vector example
+ Big commit, scary
+ Some details still a bit up in the air, mainly about move checking
structure member access ('register' types are freely copied I guess,
same as in rust? How about user types?)
Diffstat (limited to 'mod/util.c')
| -rw-r--r-- | mod/util.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mod/util.c b/mod/util.c new file mode 100644 index 0000000..c967349 --- /dev/null +++ b/mod/util.c @@ -0,0 +1,20 @@ +#include <fwd/mod.h> +#include <stdio.h> + +long fwdpanic(fwd_extern_args_t args) +{ + assert(args.argc == 1); + char *str = FWD_ARG_T(args, 0, char *); + fprintf(stderr, "%s", str); + exit(1); + return 0; +} + +int fwdopen(fwd_state_t *state) +{ + /** @todo passing around strings might be common enough to warrant its + * own type? */ + FWD_REGISTER(state, fwdpanic, + FWD_VOID, FWD_PTR); + return 0; +} |
