diff --git a/examples/dynamic_library_loading/use.v b/examples/dynamic_library_loading/use.v index 82bac72c32..3d9f456fed 100644 --- a/examples/dynamic_library_loading/use.v +++ b/examples/dynamic_library_loading/use.v @@ -9,7 +9,7 @@ fn main() { library_file_path := os.join_path(os.getwd(), dl.get_libname('library')) handle := dl.open(library_file_path, dl.rtld_lazy) eprintln('handle: ${ptr_str(handle)}') - mut f := &FNAdder(0) + mut f := FNAdder(0) f = dl.sym(handle, 'add_1') eprintln('f: ${ptr_str(f)}') res := f(1, 2) diff --git a/vlib/v/gen/c/comptime.v b/vlib/v/gen/c/comptime.v index 1b59babafe..7a64e662a4 100644 --- a/vlib/v/gen/c/comptime.v +++ b/vlib/v/gen/c/comptime.v @@ -249,11 +249,7 @@ fn (mut g Gen) comp_if(node ast.IfExpr) { } g.defer_ifdef = '' } - if node.is_expr { - g.write('#endif') - } else { - g.writeln('#endif') - } + g.writeln('#endif') } fn (mut g Gen) comp_if_cond(cond ast.Expr) bool {