From 1c0cc775732201f4c4d3ee0d6772be786b3b4aa1 Mon Sep 17 00:00:00 2001 From: Uneven Prankster Date: Sun, 15 Oct 2023 21:28:29 -0300 Subject: A lot has certainly happened! --- tinycc/lib/bt-log.c | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 tinycc/lib/bt-log.c (limited to 'tinycc/lib/bt-log.c') diff --git a/tinycc/lib/bt-log.c b/tinycc/lib/bt-log.c deleted file mode 100644 index 8f7a4db..0000000 --- a/tinycc/lib/bt-log.c +++ /dev/null @@ -1,47 +0,0 @@ -/* ------------------------------------------------------------- */ -/* function to get a stack backtrace on demand with a message */ - -#include -#include -#include - -int (*__rt_error)(void*, void*, const char *, va_list); - -#ifdef _WIN32 -# define DLL_EXPORT __declspec(dllexport) -#else -# define DLL_EXPORT -#endif - -/* Needed when using ...libtcc1-usegcc=yes in lib/Makefile */ -#if (defined(__GNUC__) && (__GNUC__ >= 6)) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wframe-address" -#endif - -DLL_EXPORT int tcc_backtrace(const char *fmt, ...) -{ - va_list ap; - int ret; - - if (__rt_error) { - void *fp = __builtin_frame_address(1); - void *ip = __builtin_return_address(0); - va_start(ap, fmt); - ret = __rt_error(fp, ip, fmt, ap); - va_end(ap); - } else { - const char *p; - if (fmt[0] == '^' && (p = strchr(fmt + 1, fmt[0]))) - fmt = p + 1; - va_start(ap, fmt); - ret = vfprintf(stderr, fmt, ap); - va_end(ap); - fprintf(stderr, "\n"), fflush(stderr); - } - return ret; -} - -#if (defined(__GNUC__) && (__GNUC__ >= 6)) || defined(__clang__) -#pragma GCC diagnostic pop -#endif -- cgit v1.2.3