examples: fix `v -cflags "-Werror" test examples/`

pull/9375/head
Delyan Angelov 2021-03-19 11:14:52 +02:00
parent 82c4daa4b7
commit 4f6306f6d4
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 2 additions and 6 deletions

View File

@ -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)

View File

@ -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 {