diff options
Diffstat (limited to 'src/stdlib/stdlib.c')
| -rw-r--r-- | src/stdlib/stdlib.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/stdlib/stdlib.c b/src/stdlib/stdlib.c index a05b8753..aabeb6b0 100644 --- a/src/stdlib/stdlib.c +++ b/src/stdlib/stdlib.c @@ -14,6 +14,7 @@ #include <time.h> #include "../config.h" +#include "../util.h" #include "files.h" #include "metamethods.h" #include "optionals.h" @@ -158,16 +159,6 @@ void tomo_init(void) { atexit(tomo_cleanup); } -public -_Noreturn void fail_text(Text_t message) { - fail(message); -} - -public -Text_t builtin_last_err() { - return Text$from_str(strerror(errno)); -} - static int _inspect_depth = 0; static file_t *file = NULL; @@ -333,7 +324,10 @@ static cleanup_t *cleanups = NULL; public void tomo_at_cleanup(Closure_t fn) { - cleanups = new (cleanup_t, .cleanup_fn = fn, .next = cleanups); + cleanup_t *new_cleanup = GC_MALLOC(sizeof(cleanup_t)); + new_cleanup->cleanup_fn = fn; + new_cleanup->next = cleanups; + cleanups = new_cleanup; } public |
