aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/stdlib.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-24 19:04:37 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-24 19:06:23 -0500
commitcb336b312e7012dc05fe7d8ac1c0e924dbc6c840 (patch)
treed2b8242e46452d12bfb1f7812f6965e64ddf9dfa /src/stdlib/stdlib.h
parent649977aae7e5922f992cd69eb84da0a2db368580 (diff)
Shuffle dependencies around so header files aren't needed after tomo has
been compiled
Diffstat (limited to 'src/stdlib/stdlib.h')
-rw-r--r--src/stdlib/stdlib.h44
1 files changed, 0 insertions, 44 deletions
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 <signal.h>
#include <stdbool.h>
#include <stdint.h>
-#include <stdio.h> // 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) \