cgen: ensure struct has empty_struct_declaration to appease msvc

pull/5346/head
Emily Hudson 2020-06-10 23:52:06 +01:00 committed by GitHub
parent 684a443b08
commit 19c3ba2f8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -3733,9 +3733,13 @@ fn (mut g Gen) go_stmt(node ast.GoStmt) {
styp := g.typ(it.receiver_type)
g.type_definitions.writeln('\t$styp arg0;')
}
for i, arg in it.args {
styp := g.typ(arg.typ)
g.type_definitions.writeln('\t$styp arg${i+1};')
if it.args.len == 0 {
g.type_definitions.writeln('EMPTY_STRUCT_DECLARATION;')
} else {
for i, arg in it.args {
styp := g.typ(arg.typ)
g.type_definitions.writeln('\t$styp arg${i+1};')
}
}
g.type_definitions.writeln('} $wrapper_struct_name;')
g.type_definitions.writeln('void* ${wrapper_fn_name}($wrapper_struct_name *arg);')