diff --git a/.gitignore b/.gitignore index 6fbc12584d..0149cfb11e 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,7 @@ fns.txt cachegrind.out.* .gdb_history *.dSYM +*.def # ignore system files .DS_Store diff --git a/vlib/builtin/builtin_windows.c.v b/vlib/builtin/builtin_windows.c.v index 98999e9777..9e48332134 100644 --- a/vlib/builtin/builtin_windows.c.v +++ b/vlib/builtin/builtin_windows.c.v @@ -71,6 +71,9 @@ fn print_backtrace_skipping_top_frames(skipframes int) bool { $if msvc { return print_backtrace_skipping_top_frames_msvc(skipframes) } + $if tinyc { + return print_backtrace_skipping_top_frames_tcc(skipframes) + } $if mingw { return print_backtrace_skipping_top_frames_mingw(skipframes) } @@ -141,6 +144,16 @@ fn print_backtrace_skipping_top_frames_mingw(skipframes int) bool { return false } +fn C.tcc_backtrace(fmt charptr, other ...charptr) int +fn print_backtrace_skipping_top_frames_tcc(skipframes int) bool { + $if tinyc { + C.tcc_backtrace("Backtrace") + return false + } $else { + eprintln('print_backtrace_skipping_top_frames_tcc must be called only when the compiler is tcc') + return false + } +} //TODO copypaste from os // we want to be able to use this here without having to `import os` @@ -198,7 +211,14 @@ fn C.IsDebuggerPresent() bool fn C.__debugbreak() fn break_if_debugger_attached() { - if C.IsDebuggerPresent() { - C.__debugbreak() + $if tinyc { + unsafe { + ptr := &voidptr(0) + *ptr = 0 + } + } $else { + if C.IsDebuggerPresent() { + C.__debugbreak() + } } } diff --git a/vlib/time/time_windows.c.v b/vlib/time/time_windows.c.v index 5a1cceb48b..0d85881fce 100644 --- a/vlib/time/time_windows.c.v +++ b/vlib/time/time_windows.c.v @@ -4,7 +4,7 @@ module time #include -#include +// #include struct C.tm { tm_year int diff --git a/vlib/v/gen/cheaders.v b/vlib/v/gen/cheaders.v index b6a0e83e7d..34637ddaae 100644 --- a/vlib/v/gen/cheaders.v +++ b/vlib/v/gen/cheaders.v @@ -44,7 +44,7 @@ const ( #define __IRQHANDLER #undef TCCSKIP #define TCCSKIP(x) -#include +// #include #endif // for __offset_of