Skip to content

Commit

Permalink
builtin: support -d gc_warn_on_stderr, to show the GC warnings, wit…
Browse files Browse the repository at this point in the history
…hout installing a custom warn fn callback
  • Loading branch information
spytheman committed Feb 11, 2024
1 parent 8793aeb commit 101b8a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion vlib/builtin/builtin_nix.c.v
Expand Up @@ -4,7 +4,9 @@
module builtin

fn builtin_init() {
gc_set_warn_proc(internal_gc_warn_proc_none)
$if !gc_warn_on_stderr ? {
gc_set_warn_proc(internal_gc_warn_proc_none)
}
}

fn break_if_debugger_attached() {
Expand Down
4 changes: 3 additions & 1 deletion vlib/builtin/builtin_windows.c.v
Expand Up @@ -48,7 +48,9 @@ const enable_wrap_at_eol_output = 2
const evable_virtual_terminal_processing = 4

fn builtin_init() {
gc_set_warn_proc(internal_gc_warn_proc_none)
$if !gc_warn_on_stderr ? {
gc_set_warn_proc(internal_gc_warn_proc_none)
}
g_original_codepage = C.GetConsoleOutputCP()
C.SetConsoleOutputCP(cp_utf8)
C.atexit(restore_codepage)
Expand Down

0 comments on commit 101b8a6

Please sign in to comment.