Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Nov 8, 2024
1 parent 80128f6 commit 2a7256f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion vlib/v/checker/fn.v
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,12 @@ fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool) ast.
tmp_c_file_with_includes.close()

os.execute('v translate fndef ${name[2..]} tmp.c')
x := os.read_file('__cdefs_autogen.v') or { return ast.void_type }
x := os.read_file('__cdefs_autogen.v') or {
for mut arg in node.args {
c.expr(mut arg.expr)
}
return ast.void_type
}
if x.contains('fn ${name}') {
println(
'function definition for ${name} has been generated in __cdefs_autogen.v. ' +
Expand All @@ -1295,6 +1300,9 @@ fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool) ast.
}
os.rm('tmp.c') or {}
}
for mut arg in node.args {
c.expr(mut arg.expr)
}
c.error('unknown function: ${node.get_name()}', node.pos)
return ast.void_type
}
Expand Down

0 comments on commit 2a7256f

Please sign in to comment.