mirror of
https://github.com/ziglang/zig.git
synced 2025-02-12 07:30:24 +00:00
std: update uses of .Inline
callconv
This commit is contained in:
parent
3ef8bb6354
commit
830230176d
@ -265,4 +265,4 @@ pub fn __builtin_mul_overflow(a: anytype, b: anytype, result: *@TypeOf(a, b)) c_
|
||||
// It is used in a run-translated-c test and a test-translate-c test to ensure that non-implemented
|
||||
// builtins are correctly demoted. If you implement __builtin_alloca_with_align, please update the
|
||||
// run-translated-c test and the test-translate-c test to use a different non-implemented builtin.
|
||||
// pub fn __builtin_alloca_with_align(size: usize, alignment: usize) callconv(.Inline) *anyopaque {}
|
||||
// pub inline fn __builtin_alloca_with_align(size: usize, alignment: usize) *anyopaque {}
|
||||
|
@ -107,15 +107,15 @@ test "zig fmt: respect line breaks before functions" {
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: rewrite callconv(.Inline) to the inline keyword" {
|
||||
test "zig fmt: rewrite callconv(.@\"inline\") to the inline keyword" {
|
||||
try testTransform(
|
||||
\\fn foo() callconv(.Inline) void {}
|
||||
\\const bar = .Inline;
|
||||
\\fn foo() callconv(.@"inline") void {}
|
||||
\\const bar: @import("std").builtin.CallingConvention = .@"inline";
|
||||
\\fn foo() callconv(bar) void {}
|
||||
\\
|
||||
,
|
||||
\\inline fn foo() void {}
|
||||
\\const bar = .Inline;
|
||||
\\const bar: @import("std").builtin.CallingConvention = .@"inline";
|
||||
\\fn foo() callconv(bar) void {}
|
||||
\\
|
||||
);
|
||||
@ -3062,7 +3062,7 @@ test "zig fmt: functions" {
|
||||
\\pub export fn puts(s: *const u8) align(2 + 2) c_int;
|
||||
\\pub inline fn puts(s: *const u8) align(2 + 2) c_int;
|
||||
\\pub noinline fn puts(s: *const u8) align(2 + 2) c_int;
|
||||
\\pub fn callInlineFn(func: fn () callconv(.Inline) void) void {
|
||||
\\pub fn callInlineFn(func: fn () callconv(.@"inline") void) void {
|
||||
\\ func();
|
||||
\\}
|
||||
\\
|
||||
|
Loading…
Reference in New Issue
Block a user