Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/c.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,18 @@ function wrapper(dest::CProject, abi_info::ABIInfo)
print(f, ", ")
end
ft = mangle_c!(typedict, arg.type, typeinfo)
print(f, ft, " ", sanitize_for_c(arg.name))
print(f, ft)
if !(isempty(arg.name) || arg.name == "#unused#")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xref JuliaLang/JuliaC.jl#121 for the #unused# to empty string change.

print(f, " ", sanitize_for_c(arg.name))
end
if arg.isva
print(f, "...")
end
end
print(f, ");\n")
end

println(f, "#endif // $libvar")
println(f, "\n#endif // $libvar")
end
end

Expand Down
9 changes: 9 additions & 0 deletions test/bindinginfo_libsimple.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
],
"returns": { "type_id": 6 }
},
{
"symbol": "unnamed_arguments",
"name": "unnamed_arguments(::Int32, ::Int32)",
"arguments": [
{ "name": "", "type_id": 4 },
{ "name": "#unused#", "type_id": 4 }
],
"returns": { "type_id": 4 }
},
{
"symbol": "copyto_and_sum",
"name": "copyto_and_sum(fromto::CVectorPair{Float32})",
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ end
@test occursin("CVector_Float32 to;", content)
@test occursin("float copyto_and_sum(CVectorPair_Float32 fromto);", content)
@test occursin("int32_t countsame(MyTwoVec* list, int32_t n);", content)
@test occursin("int32_t unnamed_arguments(int32_t, int32_t);", content)
end
end
end
Loading