zig fmt: Fix callconv rewriting for extern + string

Closes #4473
This commit is contained in:
LemonBoy 2020-02-18 22:39:19 +01:00 committed by Andrew Kelley
parent ccca4b5a5e
commit 95a71e29f8
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 3 additions and 0 deletions

View File

@ -92,10 +92,12 @@ test "zig fmt: convert extern/nakedcc/stdcallcc into callconv(...)" {
\\nakedcc fn foo1() void {}
\\stdcallcc fn foo2() void {}
\\extern fn foo3() void {}
\\extern "mylib" fn foo4() void {}
,
\\fn foo1() callconv(.Naked) void {}
\\fn foo2() callconv(.Stdcall) void {}
\\fn foo3() callconv(.C) void {}
\\fn foo4() callconv(.C) void {}
\\
);
}

View File

@ -1396,6 +1396,7 @@ fn renderExpression(
try renderToken(tree, stream, extern_export_inline_token, indent, start_col, Space.Space); // extern/export
} else {
cc_rewrite_str = ".C";
fn_proto.lib_name = null;
}
}