From cb336b312e7012dc05fe7d8ac1c0e924dbc6c840 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 24 Dec 2025 19:04:37 -0500 Subject: Shuffle dependencies around so header files aren't needed after tomo has been compiled --- src/stdlib/stdlib.h | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'src/stdlib/stdlib.h') diff --git a/src/stdlib/stdlib.h b/src/stdlib/stdlib.h index 087ed4bf..134f8ffa 100644 --- a/src/stdlib/stdlib.h +++ b/src/stdlib/stdlib.h @@ -2,14 +2,10 @@ #pragma once -#include #include #include -#include // IWYU pragma: export #include "datatypes.h" -#include "print.h" -#include "stacktrace.h" // IWYU pragma: export #include "types.h" extern bool USE_COLOR; @@ -20,46 +16,6 @@ void tomo_init(void); void tomo_at_cleanup(Closure_t fn); void tomo_cleanup(void); -#define fail(...) \ - ({ \ - tomo_cleanup(); \ - fflush(stdout); \ - if (USE_COLOR) fputs("\x1b[31;7m ==================== ERROR ==================== \033[m\n\n", stderr); \ - else fputs("==================== ERROR ====================\n\n", stderr); \ - print_stacktrace(stderr, 1); \ - if (USE_COLOR) fputs("\n\x1b[31;1m", stderr); \ - else fputs("\n", stderr); \ - fprint_inline(stderr, "Error: ", __VA_ARGS__); \ - if (USE_COLOR) fputs("\x1b[m\n", stderr); \ - else fputs("\n", stderr); \ - fflush(stderr); \ - raise(SIGABRT); \ - exit(1); \ - }) - -#define fail_source(filename, start, end, message) \ - ({ \ - tomo_cleanup(); \ - fflush(stdout); \ - if (USE_COLOR) fputs("\x1b[31;7m ==================== ERROR ==================== \n\n\x1b[0;1m", stderr); \ - else fputs("==================== ERROR ====================\n\n", stderr); \ - print_stacktrace(stderr, 0); \ - fputs("\n", stderr); \ - if (USE_COLOR) fputs("\x1b[31;1m", stderr); \ - Text$print(stderr, message); \ - file_t *_file = (filename) ? load_file(filename) : NULL; \ - if ((filename) && _file) { \ - fputs("\n", stderr); \ - highlight_error(_file, _file->text + (start), _file->text + (end), "\x1b[31;1m", 1, USE_COLOR); \ - } \ - if (USE_COLOR) fputs("\x1b[m", stderr); \ - fflush(stderr); \ - raise(SIGABRT); \ - exit(1); \ - }) - -_Noreturn void fail_text(Text_t message); -Text_t builtin_last_err(); __attribute__((nonnull)) void start_inspect(const char *filename, int64_t start, int64_t end); void end_inspect(const void *expr, const TypeInfo_t *type); #define inspect(type, expr, typeinfo, start, end) \ -- cgit v1.2.3