diff options
| author | Tom Harley | 2019-12-23 01:32:39 +0000 |
|---|---|---|
| committer | Tom Harley | 2019-12-23 01:32:39 +0000 |
| commit | 7bc67b95161a34f8eca635d4000d9602508a9243 (patch) | |
| tree | 585b3778dc1967832390e5829e4b3909b4184a2c /common.c | |
| parent | Add basics for interpreter; add CLI options (diff) | |
| download | sinter-7bc67b95161a34f8eca635d4000d9602508a9243.tar.gz sinter-7bc67b95161a34f8eca635d4000d9602508a9243.zip | |
checkpoint
Diffstat (limited to 'common.c')
| -rw-r--r-- | common.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -1,16 +1,22 @@ #include <stddef.h> -#include <gc.h> +#include <stdio.h> -#include "debug.h" +#include <gc.h> void *inter_main(void); void *debug_int(void *i) { int *p = (int *) i; - debug("%d\n", *p); + fprintf(stderr, "%d\n", *p); return i; } +void *debug_func_call(void *f) { + char *func_id = (char *) f; + fprintf(stderr, "%s\n", func_id); + return 0; +} + void *gc_alloc(int size) { void *p = GC_MALLOC(size); @@ -34,5 +40,7 @@ int main() { */ GC_INIT(); - return (int) inter_main(); + int *ret = (int *) inter_main(); + + return *ret; } |
