From 4f4567513ee3f1ada3665e4a665895a8b4fc5e2a Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 23 Apr 2020 18:03:07 +0300 Subject: [PATCH] comptime: fix `$if debug {}` when giving -cg or -d debug --- vlib/v/gen/cgen.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index 8ff633efc6..b770e7b794 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -199,8 +199,9 @@ pub fn (mut g Gen) init() { } g.comptime_defines.writeln('') } - - + if g.pref.is_debug || 'debug' in g.pref.compile_defines { + g.comptime_defines.writeln('#define _VDEBUG (1)') + } } pub fn (mut g Gen) finish() {