authorgravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2020-05-04 09:49:27-06:00
committergravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2020-05-05 09:38:02-06:00
log6745a6f6f6f2b8d4473f00bed03a6cf1af117890
tree37ae8d09b48070877421d18aa79d6a49600210f1
parentd0e996405bff4352c78c570b4944b369d642d058
signature Commit is signed but in an unrecognized format.

zig fmt


56 files changed, 222 insertions(+), 240 deletions(-)

lib/std/c.zig+1-1
......@@ -217,7 +217,7 @@ pub extern "c" fn utimes(path: [*:0]const u8, times: *[2]timeval) c_int;
217217pub extern "c" fn utimensat(dirfd: fd_t, pathname: [*:0]const u8, times: *[2]timespec, flags: u32) c_int;
218218pub extern "c" fn futimens(fd: fd_t, times: *const [2]timespec) c_int;
219219
220pub extern "c" fn pthread_create(noalias newthread: *pthread_t, noalias attr: ?*const pthread_attr_t, start_routine: extern fn (?*c_void) ?*c_void, noalias arg: ?*c_void) c_int;
220pub extern "c" fn pthread_create(noalias newthread: *pthread_t, noalias attr: ?*const pthread_attr_t, start_routine: fn (?*c_void) callconv(.C) ?*c_void, noalias arg: ?*c_void) c_int;
221221pub extern "c" fn pthread_attr_init(attr: *pthread_attr_t) c_int;
222222pub extern "c" fn pthread_attr_setstack(attr: *pthread_attr_t, stackaddr: *c_void, stacksize: usize) c_int;
223223pub extern "c" fn pthread_attr_setguardsize(attr: *pthread_attr_t, guardsize: usize) c_int;
lib/std/c/dragonfly.zig+1-1
......@@ -9,7 +9,7 @@ pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;
99pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
1010pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;
1111
12pub const dl_iterate_phdr_callback = extern fn (info: *dl_phdr_info, size: usize, data: ?*c_void) c_int;
12pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int;
1313pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int;
1414
1515pub const pthread_mutex_t = extern struct {
lib/std/c/freebsd.zig+1-1
......@@ -24,7 +24,7 @@ pub extern "c" fn sendfile(
2424 flags: u32,
2525) c_int;
2626
27pub const dl_iterate_phdr_callback = extern fn (info: *dl_phdr_info, size: usize, data: ?*c_void) c_int;
27pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int;
2828pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int;
2929
3030pub const pthread_mutex_t = extern struct {
lib/std/c/linux.zig+1-1
......@@ -75,7 +75,7 @@ pub extern "c" fn inotify_add_watch(fd: fd_t, pathname: [*]const u8, mask: u32)
7575/// See std.elf for constants for this
7676pub extern "c" fn getauxval(__type: c_ulong) c_ulong;
7777
78pub const dl_iterate_phdr_callback = extern fn (info: *dl_phdr_info, size: usize, data: ?*c_void) c_int;
78pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int;
7979pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int;
8080
8181pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
lib/std/c/netbsd.zig+1-1
......@@ -6,7 +6,7 @@ usingnamespace std.c;
66extern "c" fn __errno() *c_int;
77pub const _errno = __errno;
88
9pub const dl_iterate_phdr_callback = extern fn (info: *dl_phdr_info, size: usize, data: ?*c_void) c_int;
9pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int;
1010pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int;
1111
1212pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void;
lib/std/event/channel.zig+4-7
......@@ -105,7 +105,7 @@ pub fn Channel(comptime T: type) type {
105105
106106 /// await this function to get an item from the channel. If the buffer is empty, the frame will
107107 /// complete when the next item is put in the channel.
108 pub async fn get(self: *SelfChannel) T {
108 pub fn get(self: *SelfChannel) callconv(.Async) T {
109109 // TODO https://github.com/ziglang/zig/issues/2765
110110 var result: T = undefined;
111111 var my_tick_node = Loop.NextTickNode.init(@frame());
......@@ -305,8 +305,7 @@ test "std.event.Channel wraparound" {
305305 channel.put(7);
306306 testing.expectEqual(@as(i32, 7), channel.get());
307307}
308
309async fn testChannelGetter(channel: *Channel(i32)) void {
308fn testChannelGetter(channel: *Channel(i32)) callconv(.Async) void {
310309 const value1 = channel.get();
311310 testing.expect(value1 == 1234);
312311
......@@ -321,12 +320,10 @@ async fn testChannelGetter(channel: *Channel(i32)) void {
321320 testing.expect(value4.? == 4444);
322321 await last_put;
323322}
324
325async fn testChannelPutter(channel: *Channel(i32)) void {
323fn testChannelPutter(channel: *Channel(i32)) callconv(.Async) void {
326324 channel.put(1234);
327325 channel.put(4567);
328326}
329
330async fn testPut(channel: *Channel(i32), value: i32) void {
327fn testPut(channel: *Channel(i32), value: i32) callconv(.Async) void {
331328 channel.put(value);
332329}
lib/std/event/future.zig+2-2
......@@ -34,7 +34,7 @@ pub fn Future(comptime T: type) type {
3434 /// Obtain the value. If it's not available, wait until it becomes
3535 /// available.
3636 /// Thread-safe.
37 pub async fn get(self: *Self) *T {
37 pub fn get(self: *Self) callconv(.Async) *T {
3838 if (@atomicLoad(Available, &self.available, .SeqCst) == .Finished) {
3939 return &self.data;
4040 }
......@@ -59,7 +59,7 @@ pub fn Future(comptime T: type) type {
5959 /// should start working on the data.
6060 /// It's not required to call start() before resolve() but it can be useful since
6161 /// this method is thread-safe.
62 pub async fn start(self: *Self) ?*T {
62 pub fn start(self: *Self) callconv(.Async) ?*T {
6363 const state = @cmpxchgStrong(Available, &self.available, .NotStarted, .Started, .SeqCst, .SeqCst) orelse return null;
6464 switch (state) {
6565 .Started => {
lib/std/event/group.zig+6-10
......@@ -84,7 +84,7 @@ pub fn Group(comptime ReturnType: type) type {
8484 /// Wait for all the calls and promises of the group to complete.
8585 /// Thread-safe.
8686 /// Safe to call any number of times.
87 pub async fn wait(self: *Self) ReturnType {
87 pub fn wait(self: *Self) callconv(.Async) ReturnType {
8888 const held = self.lock.acquire();
8989 defer held.release();
9090
......@@ -127,8 +127,7 @@ test "std.event.Group" {
127127
128128 const handle = async testGroup(std.heap.page_allocator);
129129}
130
131async fn testGroup(allocator: *Allocator) void {
130fn testGroup(allocator: *Allocator) callconv(.Async) void {
132131 var count: usize = 0;
133132 var group = Group(void).init(allocator);
134133 var sleep_a_little_frame = async sleepALittle(&count);
......@@ -145,20 +144,17 @@ async fn testGroup(allocator: *Allocator) void {
145144 another.add(&something_that_fails_frame) catch @panic("memory");
146145 testing.expectError(error.ItBroke, another.wait());
147146}
148
149async fn sleepALittle(count: *usize) void {
147fn sleepALittle(count: *usize) callconv(.Async) void {
150148 std.time.sleep(1 * std.time.millisecond);
151149 _ = @atomicRmw(usize, count, .Add, 1, .SeqCst);
152150}
153
154async fn increaseByTen(count: *usize) void {
151fn increaseByTen(count: *usize) callconv(.Async) void {
155152 var i: usize = 0;
156153 while (i < 10) : (i += 1) {
157154 _ = @atomicRmw(usize, count, .Add, 1, .SeqCst);
158155 }
159156}
160
161async fn doSomethingThatFails() anyerror!void {}
162async fn somethingElse() anyerror!void {
157fn doSomethingThatFails() callconv(.Async) anyerror!void {}
158fn somethingElse() callconv(.Async) anyerror!void {
163159 return error.ItBroke;
164160}
lib/std/event/lock.zig+3-5
......@@ -89,7 +89,7 @@ pub const Lock = struct {
8989 while (self.queue.get()) |node| resume node.data;
9090 }
9191
92 pub async fn acquire(self: *Lock) Held {
92 pub fn acquire(self: *Lock) callconv(.Async) Held {
9393 var my_tick_node = Loop.NextTickNode.init(@frame());
9494
9595 errdefer _ = self.queue.remove(&my_tick_node); // TODO test canceling an acquire
......@@ -134,8 +134,7 @@ test "std.event.Lock" {
134134 const expected_result = [1]i32{3 * @intCast(i32, shared_test_data.len)} ** shared_test_data.len;
135135 testing.expectEqualSlices(i32, &expected_result, &shared_test_data);
136136}
137
138async fn testLock(lock: *Lock) void {
137fn testLock(lock: *Lock) callconv(.Async) void {
139138 var handle1 = async lockRunner(lock);
140139 var tick_node1 = Loop.NextTickNode{
141140 .prev = undefined,
......@@ -167,8 +166,7 @@ async fn testLock(lock: *Lock) void {
167166
168167var shared_test_data = [1]i32{0} ** 10;
169168var shared_test_index: usize = 0;
170
171async fn lockRunner(lock: *Lock) void {
169fn lockRunner(lock: *Lock) callconv(.Async) void {
172170 suspend; // resumed by onNextTick
173171
174172 var i: usize = 0;
lib/std/event/locked.zig+1-1
......@@ -31,7 +31,7 @@ pub fn Locked(comptime T: type) type {
3131 self.lock.deinit();
3232 }
3333
34 pub async fn acquire(self: *Self) HeldLock {
34 pub fn acquire(self: *Self) callconv(.Async) HeldLock {
3535 return HeldLock{
3636 // TODO guaranteed allocation elision
3737 .held = self.lock.acquire(),
lib/std/event/loop.zig+1-1
......@@ -503,7 +503,7 @@ pub const Loop = struct {
503503 }
504504 }
505505
506 pub async fn bsdWaitKev(self: *Loop, ident: usize, filter: i16, fflags: u32) void {
506 pub fn bsdWaitKev(self: *Loop, ident: usize, filter: i16, fflags: u32) callconv(.Async) void {
507507 var resume_node = ResumeNode.Basic{
508508 .base = ResumeNode{
509509 .id = ResumeNode.Id.Basic,
lib/std/event/rwlock.zig+5-8
......@@ -97,7 +97,7 @@ pub const RwLock = struct {
9797 while (self.reader_queue.get()) |node| resume node.data;
9898 }
9999
100 pub async fn acquireRead(self: *RwLock) HeldRead {
100 pub fn acquireRead(self: *RwLock) callconv(.Async) HeldRead {
101101 _ = @atomicRmw(usize, &self.reader_lock_count, .Add, 1, .SeqCst);
102102
103103 suspend {
......@@ -130,7 +130,7 @@ pub const RwLock = struct {
130130 return HeldRead{ .lock = self };
131131 }
132132
133 pub async fn acquireWrite(self: *RwLock) HeldWrite {
133 pub fn acquireWrite(self: *RwLock) callconv(.Async) HeldWrite {
134134 suspend {
135135 var my_tick_node = Loop.NextTickNode{
136136 .data = @frame(),
......@@ -225,8 +225,7 @@ test "std.event.RwLock" {
225225 const expected_result = [1]i32{shared_it_count * @intCast(i32, shared_test_data.len)} ** shared_test_data.len;
226226 testing.expectEqualSlices(i32, expected_result, shared_test_data);
227227}
228
229async fn testLock(allocator: *Allocator, lock: *RwLock) void {
228fn testLock(allocator: *Allocator, lock: *RwLock) callconv(.Async) void {
230229 var read_nodes: [100]Loop.NextTickNode = undefined;
231230 for (read_nodes) |*read_node| {
232231 const frame = allocator.create(@Frame(readRunner)) catch @panic("memory");
......@@ -259,8 +258,7 @@ const shared_it_count = 10;
259258var shared_test_data = [1]i32{0} ** 10;
260259var shared_test_index: usize = 0;
261260var shared_count: usize = 0;
262
263async fn writeRunner(lock: *RwLock) void {
261fn writeRunner(lock: *RwLock) callconv(.Async) void {
264262 suspend; // resumed by onNextTick
265263
266264 var i: usize = 0;
......@@ -277,8 +275,7 @@ async fn writeRunner(lock: *RwLock) void {
277275 shared_test_index = 0;
278276 }
279277}
280
281async fn readRunner(lock: *RwLock) void {
278fn readRunner(lock: *RwLock) callconv(.Async) void {
282279 suspend; // resumed by onNextTick
283280 std.time.sleep(1);
284281
lib/std/event/rwlocked.zig+2-2
......@@ -40,14 +40,14 @@ pub fn RwLocked(comptime T: type) type {
4040 self.lock.deinit();
4141 }
4242
43 pub async fn acquireRead(self: *Self) HeldReadLock {
43 pub fn acquireRead(self: *Self) callconv(.Async) HeldReadLock {
4444 return HeldReadLock{
4545 .held = self.lock.acquireRead(),
4646 .value = &self.locked_data,
4747 };
4848 }
4949
50 pub async fn acquireWrite(self: *Self) HeldWriteLock {
50 pub fn acquireWrite(self: *Self) callconv(.Async) HeldWriteLock {
5151 return HeldWriteLock{
5252 .held = self.lock.acquireWrite(),
5353 .value = &self.locked_data,
lib/std/os/bits/darwin.zig+1-1
......@@ -125,7 +125,7 @@ pub const empty_sigset = sigset_t(0);
125125
126126/// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name.
127127pub const Sigaction = extern struct {
128 handler: extern fn (c_int) void,
128 handler: fn (c_int) callconv(.C) void,
129129 sa_mask: sigset_t,
130130 sa_flags: c_int,
131131};
lib/std/os/bits/dragonfly.zig+6-6
......@@ -458,9 +458,9 @@ pub const S_IFSOCK = 49152;
458458pub const S_IFWHT = 57344;
459459pub const S_IFMT = 61440;
460460
461pub const SIG_ERR = @intToPtr(extern fn (i32) void, maxInt(usize));
462pub const SIG_DFL = @intToPtr(extern fn (i32) void, 0);
463pub const SIG_IGN = @intToPtr(extern fn (i32) void, 1);
461pub const SIG_ERR = @intToPtr(fn (i32) callconv(.C) void, maxInt(usize));
462pub const SIG_DFL = @intToPtr(fn (i32) callconv(.C) void, 0);
463pub const SIG_IGN = @intToPtr(fn (i32) callconv(.C) void, 1);
464464pub const BADSIG = SIG_ERR;
465465pub const SIG_BLOCK = 1;
466466pub const SIG_UNBLOCK = 2;
......@@ -519,13 +519,13 @@ pub const sigset_t = extern struct {
519519pub const sig_atomic_t = c_int;
520520pub const Sigaction = extern struct {
521521 __sigaction_u: extern union {
522 __sa_handler: ?extern fn (c_int) void,
523 __sa_sigaction: ?extern fn (c_int, [*c]siginfo_t, ?*c_void) void,
522 __sa_handler: ?fn (c_int) callconv(.C) void,
523 __sa_sigaction: ?fn (c_int, [*c]siginfo_t, ?*c_void) callconv(.C) void,
524524 },
525525 sa_flags: c_int,
526526 sa_mask: sigset_t,
527527};
528pub const sig_t = [*c]extern fn (c_int) void;
528pub const sig_t = [*c]fn (c_int) callconv(.C) void;
529529
530530pub const sigvec = extern struct {
531531 sv_handler: [*c]__sighandler_t,
lib/std/os/bits/freebsd.zig+5-5
......@@ -725,16 +725,16 @@ pub const winsize = extern struct {
725725
726726const NSIG = 32;
727727
728pub const SIG_ERR = @intToPtr(extern fn (i32) void, maxInt(usize));
729pub const SIG_DFL = @intToPtr(extern fn (i32) void, 0);
730pub const SIG_IGN = @intToPtr(extern fn (i32) void, 1);
728pub const SIG_ERR = @intToPtr(fn (i32) callconv(.C) void, maxInt(usize));
729pub const SIG_DFL = @intToPtr(fn (i32) callconv(.C) void, 0);
730pub const SIG_IGN = @intToPtr(fn (i32) callconv(.C) void, 1);
731731
732732/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
733733pub const Sigaction = extern struct {
734734 /// signal handler
735735 __sigaction_u: extern union {
736 __sa_handler: extern fn (i32) void,
737 __sa_sigaction: extern fn (i32, *__siginfo, usize) void,
736 __sa_handler: fn (i32) callconv(.C) void,
737 __sa_sigaction: fn (i32, *__siginfo, usize) callconv(.C) void,
738738 },
739739
740740 /// see signal options
lib/std/os/bits/linux.zig+5-5
......@@ -813,15 +813,15 @@ pub const app_mask: sigset_t = [2]u32{ 0xfffffffc, 0x7fffffff } ++ [_]u32{0xffff
813813pub const k_sigaction = if (is_mips)
814814 extern struct {
815815 flags: usize,
816 sigaction: ?extern fn (i32, *siginfo_t, ?*c_void) void,
816 sigaction: ?fn (i32, *siginfo_t, ?*c_void) callconv(.C) void,
817817 mask: [4]u32,
818 restorer: extern fn () void,
818 restorer: fn () callconv(.C) void,
819819 }
820820else
821821 extern struct {
822 sigaction: ?extern fn (i32, *siginfo_t, ?*c_void) void,
822 sigaction: ?fn (i32, *siginfo_t, ?*c_void) callconv(.C) void,
823823 flags: usize,
824 restorer: extern fn () void,
824 restorer: fn () callconv(.C) void,
825825 mask: [2]u32,
826826 };
827827
......@@ -831,7 +831,7 @@ pub const Sigaction = extern struct {
831831 sigaction: ?sigaction_fn,
832832 mask: sigset_t,
833833 flags: u32,
834 restorer: ?extern fn () void = null,
834 restorer: ?fn () callconv(.C) void = null,
835835};
836836
837837pub const SIG_ERR = @intToPtr(?Sigaction.sigaction_fn, maxInt(usize));
lib/std/os/linux.zig+2-2
......@@ -599,7 +599,7 @@ pub fn flock(fd: fd_t, operation: i32) usize {
599599var vdso_clock_gettime = @ptrCast(?*const c_void, init_vdso_clock_gettime);
600600
601601// We must follow the C calling convention when we call into the VDSO
602const vdso_clock_gettime_ty = extern fn (i32, *timespec) usize;
602const vdso_clock_gettime_ty = fn (i32, *timespec) callconv(.C) usize;
603603
604604pub fn clock_gettime(clk_id: i32, tp: *timespec) usize {
605605 if (@hasDecl(@This(), "VDSO_CGT_SYM")) {
......@@ -791,7 +791,7 @@ pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigacti
791791 .sigaction = act.sigaction,
792792 .flags = act.flags | SA_RESTORER,
793793 .mask = undefined,
794 .restorer = @ptrCast(extern fn () void, restorer_fn),
794 .restorer = @ptrCast(fn () callconv(.C) void, restorer_fn),
795795 };
796796 var ksa_old: k_sigaction = undefined;
797797 const ksa_mask_size = @sizeOf(@TypeOf(ksa_old.mask));
lib/std/os/linux/arm-eabi.zig+1-1
......@@ -86,7 +86,7 @@ pub fn syscall6(
8686}
8787
8888/// This matches the libc clone function.
89pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
89pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
9090
9191pub fn restore() callconv(.Naked) void {
9292 return asm volatile ("svc #0"
lib/std/os/linux/arm64.zig+1-1
......@@ -86,7 +86,7 @@ pub fn syscall6(
8686}
8787
8888/// This matches the libc clone function.
89pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
89pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
9090
9191pub const restore = restore_rt;
9292
lib/std/os/linux/i386.zig+1-1
......@@ -106,7 +106,7 @@ pub fn socketcall(call: usize, args: [*]usize) usize {
106106}
107107
108108/// This matches the libc clone function.
109pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
109pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
110110
111111pub fn restore() callconv(.Naked) void {
112112 return asm volatile ("int $0x80"
lib/std/os/linux/mips.zig+1-1
......@@ -142,7 +142,7 @@ pub fn syscall6(
142142}
143143
144144/// This matches the libc clone function.
145pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
145pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
146146
147147pub fn restore() callconv(.Naked) void {
148148 return asm volatile ("syscall"
lib/std/os/linux/riscv64.zig+1-1
......@@ -85,7 +85,7 @@ pub fn syscall6(
8585 );
8686}
8787
88pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
88pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
8989
9090pub const restore = restore_rt;
9191
lib/std/os/linux/x86_64.zig+1-1
......@@ -86,7 +86,7 @@ pub fn syscall6(
8686}
8787
8888/// This matches the libc clone function.
89pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
89pub extern fn clone(func: fn (arg: usize) callconv(.C) u8, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize;
9090
9191pub const restore = restore_rt;
9292
lib/std/os/uefi/protocols/absolute_pointer_protocol.zig+2-2
......@@ -5,8 +5,8 @@ const Status = uefi.Status;
55
66/// Protocol for touchscreens
77pub const AbsolutePointerProtocol = extern struct {
8 _reset: extern fn (*const AbsolutePointerProtocol, bool) Status,
9 _get_state: extern fn (*const AbsolutePointerProtocol, *AbsolutePointerState) Status,
8 _reset: fn (*const AbsolutePointerProtocol, bool) callconv(.C) Status,
9 _get_state: fn (*const AbsolutePointerProtocol, *AbsolutePointerState) callconv(.C) Status,
1010 wait_for_input: Event,
1111 mode: *AbsolutePointerMode,
1212
lib/std/os/uefi/protocols/edid_override_protocol.zig+1-1
......@@ -5,7 +5,7 @@ const Status = uefi.Status;
55
66/// Override EDID information
77pub const EdidOverrideProtocol = extern struct {
8 _get_edid: extern fn (*const EdidOverrideProtocol, Handle, *u32, *usize, *?[*]u8) Status,
8 _get_edid: fn (*const EdidOverrideProtocol, Handle, *u32, *usize, *?[*]u8) callconv(.C) Status,
99
1010 /// Returns policy information and potentially a replacement EDID for the specified video output device.
1111 /// attributes must be align(4)
lib/std/os/uefi/protocols/file_protocol.zig+10-10
......@@ -5,16 +5,16 @@ const Status = uefi.Status;
55
66pub const FileProtocol = extern struct {
77 revision: u64,
8 _open: extern fn (*const FileProtocol, **const FileProtocol, [*:0]const u16, u64, u64) Status,
9 _close: extern fn (*const FileProtocol) Status,
10 _delete: extern fn (*const FileProtocol) Status,
11 _read: extern fn (*const FileProtocol, *usize, [*]u8) Status,
12 _write: extern fn (*const FileProtocol, *usize, [*]const u8) Status,
13 _get_position: extern fn (*const FileProtocol, *u64) Status,
14 _set_position: extern fn (*const FileProtocol, *const u64) Status,
15 _get_info: extern fn (*const FileProtocol, *align(8) const Guid, *const usize, [*]u8) Status,
16 _set_info: extern fn (*const FileProtocol, *align(8) const Guid, usize, [*]const u8) Status,
17 _flush: extern fn (*const FileProtocol) Status,
8 _open: fn (*const FileProtocol, **const FileProtocol, [*:0]const u16, u64, u64) callconv(.C) Status,
9 _close: fn (*const FileProtocol) callconv(.C) Status,
10 _delete: fn (*const FileProtocol) callconv(.C) Status,
11 _read: fn (*const FileProtocol, *usize, [*]u8) callconv(.C) Status,
12 _write: fn (*const FileProtocol, *usize, [*]const u8) callconv(.C) Status,
13 _get_position: fn (*const FileProtocol, *u64) callconv(.C) Status,
14 _set_position: fn (*const FileProtocol, *const u64) callconv(.C) Status,
15 _get_info: fn (*const FileProtocol, *align(8) const Guid, *const usize, [*]u8) callconv(.C) Status,
16 _set_info: fn (*const FileProtocol, *align(8) const Guid, usize, [*]const u8) callconv(.C) Status,
17 _flush: fn (*const FileProtocol) callconv(.C) Status,
1818
1919 pub fn open(self: *const FileProtocol, new_handle: **const FileProtocol, file_name: [*:0]const u16, open_mode: u64, attributes: u64) Status {
2020 return self._open(self, new_handle, file_name, open_mode, attributes);
lib/std/os/uefi/protocols/graphics_output_protocol.zig+3-3
......@@ -4,9 +4,9 @@ const Status = uefi.Status;
44
55/// Graphics output
66pub const GraphicsOutputProtocol = extern struct {
7 _query_mode: extern fn (*const GraphicsOutputProtocol, u32, *usize, **GraphicsOutputModeInformation) Status,
8 _set_mode: extern fn (*const GraphicsOutputProtocol, u32) Status,
9 _blt: extern fn (*const GraphicsOutputProtocol, ?[*]GraphicsOutputBltPixel, GraphicsOutputBltOperation, usize, usize, usize, usize, usize, usize, usize) Status,
7 _query_mode: fn (*const GraphicsOutputProtocol, u32, *usize, **GraphicsOutputModeInformation) callconv(.C) Status,
8 _set_mode: fn (*const GraphicsOutputProtocol, u32) callconv(.C) Status,
9 _blt: fn (*const GraphicsOutputProtocol, ?[*]GraphicsOutputBltPixel, GraphicsOutputBltOperation, usize, usize, usize, usize, usize, usize, usize) callconv(.C) Status,
1010 mode: *GraphicsOutputProtocolMode,
1111
1212 /// Returns information for an available graphics mode that the graphics device and the set of active video output devices supports.
lib/std/os/uefi/protocols/hii_database_protocol.zig+4-4
......@@ -6,10 +6,10 @@ const hii = uefi.protocols.hii;
66/// Database manager for HII-related data structures.
77pub const HIIDatabaseProtocol = extern struct {
88 _new_package_list: Status, // TODO
9 _remove_package_list: extern fn (*const HIIDatabaseProtocol, hii.HIIHandle) Status,
10 _update_package_list: extern fn (*const HIIDatabaseProtocol, hii.HIIHandle, *const hii.HIIPackageList) Status,
11 _list_package_lists: extern fn (*const HIIDatabaseProtocol, u8, ?*const Guid, *usize, [*]hii.HIIHandle) Status,
12 _export_package_lists: extern fn (*const HIIDatabaseProtocol, ?hii.HIIHandle, *usize, *hii.HIIPackageList) Status,
9 _remove_package_list: fn (*const HIIDatabaseProtocol, hii.HIIHandle) callconv(.C) Status,
10 _update_package_list: fn (*const HIIDatabaseProtocol, hii.HIIHandle, *const hii.HIIPackageList) callconv(.C) Status,
11 _list_package_lists: fn (*const HIIDatabaseProtocol, u8, ?*const Guid, *usize, [*]hii.HIIHandle) callconv(.C) Status,
12 _export_package_lists: fn (*const HIIDatabaseProtocol, ?hii.HIIHandle, *usize, *hii.HIIPackageList) callconv(.C) Status,
1313 _register_package_notify: Status, // TODO
1414 _unregister_package_notify: Status, // TODO
1515 _find_keyboard_layouts: Status, // TODO
lib/std/os/uefi/protocols/hii_popup_protocol.zig+1-1
......@@ -6,7 +6,7 @@ const hii = uefi.protocols.hii;
66/// Display a popup window
77pub const HIIPopupProtocol = extern struct {
88 revision: u64,
9 _create_popup: extern fn (*const HIIPopupProtocol, HIIPopupStyle, HIIPopupType, hii.HIIHandle, u16, ?*HIIPopupSelection) Status,
9 _create_popup: fn (*const HIIPopupProtocol, HIIPopupStyle, HIIPopupType, hii.HIIHandle, u16, ?*HIIPopupSelection) callconv(.C) Status,
1010
1111 /// Displays a popup window.
1212 pub fn createPopup(self: *const HIIPopupProtocol, style: HIIPopupStyle, popup_type: HIIPopupType, handle: hii.HIIHandle, msg: u16, user_selection: ?*HIIPopupSelection) Status {
lib/std/os/uefi/protocols/ip6_config_protocol.zig+4-4
......@@ -4,10 +4,10 @@ const Event = uefi.Event;
44const Status = uefi.Status;
55
66pub const Ip6ConfigProtocol = extern struct {
7 _set_data: extern fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, usize, *const c_void) Status,
8 _get_data: extern fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, *usize, ?*const c_void) Status,
9 _register_data_notify: extern fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) Status,
10 _unregister_data_notify: extern fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) Status,
7 _set_data: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, usize, *const c_void) callconv(.C) Status,
8 _get_data: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, *usize, ?*const c_void) callconv(.C) Status,
9 _register_data_notify: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status,
10 _unregister_data_notify: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status,
1111
1212 pub fn setData(self: *const Ip6ConfigProtocol, data_type: Ip6ConfigDataType, data_size: usize, data: *const c_void) Status {
1313 return self._set_data(self, data_type, data_size, data);
lib/std/os/uefi/protocols/ip6_protocol.zig+9-9
......@@ -7,15 +7,15 @@ const ManagedNetworkConfigData = uefi.protocols.ManagedNetworkConfigData;
77const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;
88
99pub const Ip6Protocol = extern struct {
10 _get_mode_data: extern fn (*const Ip6Protocol, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) Status,
11 _configure: extern fn (*const Ip6Protocol, ?*const Ip6ConfigData) Status,
12 _groups: extern fn (*const Ip6Protocol, bool, ?*const Ip6Address) Status,
13 _routes: extern fn (*const Ip6Protocol, bool, ?*const Ip6Address, u8, ?*const Ip6Address) Status,
14 _neighbors: extern fn (*const Ip6Protocol, bool, *const Ip6Address, ?*const MacAddress, u32, bool) Status,
15 _transmit: extern fn (*const Ip6Protocol, *Ip6CompletionToken) Status,
16 _receive: extern fn (*const Ip6Protocol, *Ip6CompletionToken) Status,
17 _cancel: extern fn (*const Ip6Protocol, ?*Ip6CompletionToken) Status,
18 _poll: extern fn (*const Ip6Protocol) Status,
10 _get_mode_data: fn (*const Ip6Protocol, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status,
11 _configure: fn (*const Ip6Protocol, ?*const Ip6ConfigData) callconv(.C) Status,
12 _groups: fn (*const Ip6Protocol, bool, ?*const Ip6Address) callconv(.C) Status,
13 _routes: fn (*const Ip6Protocol, bool, ?*const Ip6Address, u8, ?*const Ip6Address) callconv(.C) Status,
14 _neighbors: fn (*const Ip6Protocol, bool, *const Ip6Address, ?*const MacAddress, u32, bool) callconv(.C) Status,
15 _transmit: fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status,
16 _receive: fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status,
17 _cancel: fn (*const Ip6Protocol, ?*Ip6CompletionToken) callconv(.C) Status,
18 _poll: fn (*const Ip6Protocol) callconv(.C) Status,
1919
2020 /// Gets the current operational settings for this instance of the EFI IPv6 Protocol driver.
2121 pub fn getModeData(self: *const Ip6Protocol, ip6_mode_data: ?*Ip6ModeData, mnp_config_data: ?*ManagedNetworkConfigData, snp_mode_data: ?*SimpleNetworkMode) Status {
lib/std/os/uefi/protocols/ip6_service_binding_protocol.zig+2-2
......@@ -4,8 +4,8 @@ const Guid = uefi.Guid;
44const Status = uefi.Status;
55
66pub const Ip6ServiceBindingProtocol = extern struct {
7 _create_child: extern fn (*const Ip6ServiceBindingProtocol, *?Handle) Status,
8 _destroy_child: extern fn (*const Ip6ServiceBindingProtocol, Handle) Status,
7 _create_child: fn (*const Ip6ServiceBindingProtocol, *?Handle) callconv(.C) Status,
8 _destroy_child: fn (*const Ip6ServiceBindingProtocol, Handle) callconv(.C) Status,
99
1010 pub fn createChild(self: *const Ip6ServiceBindingProtocol, handle: *?Handle) Status {
1111 return self._create_child(self, handle);
lib/std/os/uefi/protocols/loaded_image_protocol.zig+1-1
......@@ -19,7 +19,7 @@ pub const LoadedImageProtocol = extern struct {
1919 image_size: u64,
2020 image_code_type: MemoryType,
2121 image_data_type: MemoryType,
22 _unload: extern fn (*const LoadedImageProtocol, Handle) Status,
22 _unload: fn (*const LoadedImageProtocol, Handle) callconv(.C) Status,
2323
2424 /// Unloads an image from memory.
2525 pub fn unload(self: *const LoadedImageProtocol, handle: Handle) Status {
lib/std/os/uefi/protocols/managed_network_protocol.zig+8-8
......@@ -7,14 +7,14 @@ const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;
77const MacAddress = uefi.protocols.MacAddress;
88
99pub const ManagedNetworkProtocol = extern struct {
10 _get_mode_data: extern fn (*const ManagedNetworkProtocol, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) Status,
11 _configure: extern fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkConfigData) Status,
12 _mcast_ip_to_mac: extern fn (*const ManagedNetworkProtocol, bool, *const c_void, *MacAddress) Status,
13 _groups: extern fn (*const ManagedNetworkProtocol, bool, ?*const MacAddress) Status,
14 _transmit: extern fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) Status,
15 _receive: extern fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) Status,
16 _cancel: extern fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkCompletionToken) Status,
17 _poll: extern fn (*const ManagedNetworkProtocol) usize,
10 _get_mode_data: fn (*const ManagedNetworkProtocol, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status,
11 _configure: fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkConfigData) callconv(.C) Status,
12 _mcast_ip_to_mac: fn (*const ManagedNetworkProtocol, bool, *const c_void, *MacAddress) callconv(.C) Status,
13 _groups: fn (*const ManagedNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status,
14 _transmit: fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status,
15 _receive: fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status,
16 _cancel: fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkCompletionToken) callconv(.C) Status,
17 _poll: fn (*const ManagedNetworkProtocol) callconv(.C) usize,
1818
1919 /// Returns the operational parameters for the current MNP child driver.
2020 /// May also support returning the underlying SNP driver mode data.
lib/std/os/uefi/protocols/managed_network_service_binding_protocol.zig+2-2
......@@ -4,8 +4,8 @@ const Guid = uefi.Guid;
44const Status = uefi.Status;
55
66pub const ManagedNetworkServiceBindingProtocol = extern struct {
7 _create_child: extern fn (*const ManagedNetworkServiceBindingProtocol, *?Handle) Status,
8 _destroy_child: extern fn (*const ManagedNetworkServiceBindingProtocol, Handle) Status,
7 _create_child: fn (*const ManagedNetworkServiceBindingProtocol, *?Handle) callconv(.C) Status,
8 _destroy_child: fn (*const ManagedNetworkServiceBindingProtocol, Handle) callconv(.C) Status,
99
1010 pub fn createChild(self: *const ManagedNetworkServiceBindingProtocol, handle: *?Handle) Status {
1111 return self._create_child(self, handle);
lib/std/os/uefi/protocols/rng_protocol.zig+2-2
......@@ -4,8 +4,8 @@ const Status = uefi.Status;
44
55/// Random Number Generator protocol
66pub const RNGProtocol = extern struct {
7 _get_info: extern fn (*const RNGProtocol, *usize, [*]align(8) Guid) Status,
8 _get_rng: extern fn (*const RNGProtocol, ?*align(8) const Guid, usize, [*]u8) Status,
7 _get_info: fn (*const RNGProtocol, *usize, [*]align(8) Guid) callconv(.C) Status,
8 _get_rng: fn (*const RNGProtocol, ?*align(8) const Guid, usize, [*]u8) callconv(.C) Status,
99
1010 /// Returns information about the random number generation implementation.
1111 pub fn getInfo(self: *const RNGProtocol, list_size: *usize, list: [*]align(8) Guid) Status {
lib/std/os/uefi/protocols/simple_file_system_protocol.zig+1-1
......@@ -5,7 +5,7 @@ const Status = uefi.Status;
55
66pub const SimpleFileSystemProtocol = extern struct {
77 revision: u64,
8 _open_volume: extern fn (*const SimpleFileSystemProtocol, **const FileProtocol) Status,
8 _open_volume: fn (*const SimpleFileSystemProtocol, **const FileProtocol) callconv(.C) Status,
99
1010 pub fn openVolume(self: *const SimpleFileSystemProtocol, root: **const FileProtocol) Status {
1111 return self._open_volume(self, root);
lib/std/os/uefi/protocols/simple_network_protocol.zig+13-13
......@@ -5,19 +5,19 @@ const Status = uefi.Status;
55
66pub const SimpleNetworkProtocol = extern struct {
77 revision: u64,
8 _start: extern fn (*const SimpleNetworkProtocol) Status,
9 _stop: extern fn (*const SimpleNetworkProtocol) Status,
10 _initialize: extern fn (*const SimpleNetworkProtocol, usize, usize) Status,
11 _reset: extern fn (*const SimpleNetworkProtocol, bool) Status,
12 _shutdown: extern fn (*const SimpleNetworkProtocol) Status,
13 _receive_filters: extern fn (*const SimpleNetworkProtocol, SimpleNetworkReceiveFilter, SimpleNetworkReceiveFilter, bool, usize, ?[*]const MacAddress) Status,
14 _station_address: extern fn (*const SimpleNetworkProtocol, bool, ?*const MacAddress) Status,
15 _statistics: extern fn (*const SimpleNetworkProtocol, bool, ?*usize, ?*NetworkStatistics) Status,
16 _mcast_ip_to_mac: extern fn (*const SimpleNetworkProtocol, bool, *const c_void, *MacAddress) Status,
17 _nvdata: extern fn (*const SimpleNetworkProtocol, bool, usize, usize, [*]u8) Status,
18 _get_status: extern fn (*const SimpleNetworkProtocol, *SimpleNetworkInterruptStatus, ?*?[*]u8) Status,
19 _transmit: extern fn (*const SimpleNetworkProtocol, usize, usize, [*]const u8, ?*const MacAddress, ?*const MacAddress, ?*const u16) Status,
20 _receive: extern fn (*const SimpleNetworkProtocol, ?*usize, *usize, [*]u8, ?*MacAddress, ?*MacAddress, ?*u16) Status,
8 _start: fn (*const SimpleNetworkProtocol) callconv(.C) Status,
9 _stop: fn (*const SimpleNetworkProtocol) callconv(.C) Status,
10 _initialize: fn (*const SimpleNetworkProtocol, usize, usize) callconv(.C) Status,
11 _reset: fn (*const SimpleNetworkProtocol, bool) callconv(.C) Status,
12 _shutdown: fn (*const SimpleNetworkProtocol) callconv(.C) Status,
13 _receive_filters: fn (*const SimpleNetworkProtocol, SimpleNetworkReceiveFilter, SimpleNetworkReceiveFilter, bool, usize, ?[*]const MacAddress) callconv(.C) Status,
14 _station_address: fn (*const SimpleNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status,
15 _statistics: fn (*const SimpleNetworkProtocol, bool, ?*usize, ?*NetworkStatistics) callconv(.C) Status,
16 _mcast_ip_to_mac: fn (*const SimpleNetworkProtocol, bool, *const c_void, *MacAddress) callconv(.C) Status,
17 _nvdata: fn (*const SimpleNetworkProtocol, bool, usize, usize, [*]u8) callconv(.C) Status,
18 _get_status: fn (*const SimpleNetworkProtocol, *SimpleNetworkInterruptStatus, ?*?[*]u8) callconv(.C) Status,
19 _transmit: fn (*const SimpleNetworkProtocol, usize, usize, [*]const u8, ?*const MacAddress, ?*const MacAddress, ?*const u16) callconv(.C) Status,
20 _receive: fn (*const SimpleNetworkProtocol, ?*usize, *usize, [*]u8, ?*MacAddress, ?*MacAddress, ?*u16) callconv(.C) Status,
2121 wait_for_packet: Event,
2222 mode: *SimpleNetworkMode,
2323
lib/std/os/uefi/protocols/simple_pointer_protocol.zig+2-2
......@@ -5,8 +5,8 @@ const Status = uefi.Status;
55
66/// Protocol for mice
77pub const SimplePointerProtocol = struct {
8 _reset: extern fn (*const SimplePointerProtocol, bool) Status,
9 _get_state: extern fn (*const SimplePointerProtocol, *SimplePointerState) Status,
8 _reset: fn (*const SimplePointerProtocol, bool) callconv(.C) Status,
9 _get_state: fn (*const SimplePointerProtocol, *SimplePointerState) callconv(.C) Status,
1010 wait_for_input: Event,
1111 mode: *SimplePointerMode,
1212
lib/std/os/uefi/protocols/simple_text_input_ex_protocol.zig+6-6
......@@ -5,12 +5,12 @@ const Status = uefi.Status;
55
66/// Character input devices, e.g. Keyboard
77pub const SimpleTextInputExProtocol = extern struct {
8 _reset: extern fn (*const SimpleTextInputExProtocol, bool) Status,
9 _read_key_stroke_ex: extern fn (*const SimpleTextInputExProtocol, *KeyData) Status,
8 _reset: fn (*const SimpleTextInputExProtocol, bool) callconv(.C) Status,
9 _read_key_stroke_ex: fn (*const SimpleTextInputExProtocol, *KeyData) callconv(.C) Status,
1010 wait_for_key_ex: Event,
11 _set_state: extern fn (*const SimpleTextInputExProtocol, *const u8) Status,
12 _register_key_notify: extern fn (*const SimpleTextInputExProtocol, *const KeyData, extern fn (*const KeyData) usize, **c_void) Status,
13 _unregister_key_notify: extern fn (*const SimpleTextInputExProtocol, *const c_void) Status,
11 _set_state: fn (*const SimpleTextInputExProtocol, *const u8) callconv(.C) Status,
12 _register_key_notify: fn (*const SimpleTextInputExProtocol, *const KeyData, fn (*const KeyData) callconv(.C) usize, **c_void) callconv(.C) Status,
13 _unregister_key_notify: fn (*const SimpleTextInputExProtocol, *const c_void) callconv(.C) Status,
1414
1515 /// Resets the input device hardware.
1616 pub fn reset(self: *const SimpleTextInputExProtocol, verify: bool) Status {
......@@ -28,7 +28,7 @@ pub const SimpleTextInputExProtocol = extern struct {
2828 }
2929
3030 /// Register a notification function for a particular keystroke for the input device.
31 pub fn registerKeyNotify(self: *const SimpleTextInputExProtocol, key_data: *const KeyData, notify: extern fn (*const KeyData) usize, handle: **c_void) Status {
31 pub fn registerKeyNotify(self: *const SimpleTextInputExProtocol, key_data: *const KeyData, notify: fn (*const KeyData) callconv(.C) usize, handle: **c_void) Status {
3232 return self._register_key_notify(self, key_data, notify, handle);
3333 }
3434
lib/std/os/uefi/protocols/simple_text_input_protocol.zig+2-2
......@@ -6,8 +6,8 @@ const Status = uefi.Status;
66
77/// Character input devices, e.g. Keyboard
88pub const SimpleTextInputProtocol = extern struct {
9 _reset: extern fn (*const SimpleTextInputProtocol, bool) usize,
10 _read_key_stroke: extern fn (*const SimpleTextInputProtocol, *InputKey) Status,
9 _reset: fn (*const SimpleTextInputProtocol, bool) callconv(.C) usize,
10 _read_key_stroke: fn (*const SimpleTextInputProtocol, *InputKey) callconv(.C) Status,
1111 wait_for_key: Event,
1212
1313 /// Resets the input device hardware.
lib/std/os/uefi/protocols/simple_text_output_protocol.zig+9-9
......@@ -4,15 +4,15 @@ const Status = uefi.Status;
44
55/// Character output devices
66pub const SimpleTextOutputProtocol = extern struct {
7 _reset: extern fn (*const SimpleTextOutputProtocol, bool) Status,
8 _output_string: extern fn (*const SimpleTextOutputProtocol, [*:0]const u16) Status,
9 _test_string: extern fn (*const SimpleTextOutputProtocol, [*:0]const u16) Status,
10 _query_mode: extern fn (*const SimpleTextOutputProtocol, usize, *usize, *usize) Status,
11 _set_mode: extern fn (*const SimpleTextOutputProtocol, usize) Status,
12 _set_attribute: extern fn (*const SimpleTextOutputProtocol, usize) Status,
13 _clear_screen: extern fn (*const SimpleTextOutputProtocol) Status,
14 _set_cursor_position: extern fn (*const SimpleTextOutputProtocol, usize, usize) Status,
15 _enable_cursor: extern fn (*const SimpleTextOutputProtocol, bool) Status,
7 _reset: fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status,
8 _output_string: fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status,
9 _test_string: fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status,
10 _query_mode: fn (*const SimpleTextOutputProtocol, usize, *usize, *usize) callconv(.C) Status,
11 _set_mode: fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status,
12 _set_attribute: fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status,
13 _clear_screen: fn (*const SimpleTextOutputProtocol) callconv(.C) Status,
14 _set_cursor_position: fn (*const SimpleTextOutputProtocol, usize, usize) callconv(.C) Status,
15 _enable_cursor: fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status,
1616 mode: *SimpleTextOutputMode,
1717
1818 /// Resets the text output device hardware.
lib/std/os/uefi/protocols/udp6_protocol.zig+7-7
......@@ -9,13 +9,13 @@ const ManagedNetworkConfigData = uefi.protocols.ManagedNetworkConfigData;
99const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode;
1010
1111pub const Udp6Protocol = extern struct {
12 _get_mode_data: extern fn (*const Udp6Protocol, ?*Udp6ConfigData, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) Status,
13 _configure: extern fn (*const Udp6Protocol, ?*const Udp6ConfigData) Status,
14 _groups: extern fn (*const Udp6Protocol, bool, ?*const Ip6Address) Status,
15 _transmit: extern fn (*const Udp6Protocol, *Udp6CompletionToken) Status,
16 _receive: extern fn (*const Udp6Protocol, *Udp6CompletionToken) Status,
17 _cancel: extern fn (*const Udp6Protocol, ?*Udp6CompletionToken) Status,
18 _poll: extern fn (*const Udp6Protocol) Status,
12 _get_mode_data: fn (*const Udp6Protocol, ?*Udp6ConfigData, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status,
13 _configure: fn (*const Udp6Protocol, ?*const Udp6ConfigData) callconv(.C) Status,
14 _groups: fn (*const Udp6Protocol, bool, ?*const Ip6Address) callconv(.C) Status,
15 _transmit: fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status,
16 _receive: fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status,
17 _cancel: fn (*const Udp6Protocol, ?*Udp6CompletionToken) callconv(.C) Status,
18 _poll: fn (*const Udp6Protocol) callconv(.C) Status,
1919
2020 pub fn getModeData(self: *const Udp6Protocol, udp6_config_data: ?*Udp6ConfigData, ip6_mode_data: ?*Ip6ModeData, mnp_config_data: ?*ManagedNetworkConfigData, snp_mode_data: ?*SimpleNetworkMode) Status {
2121 return self._get_mode_data(self, udp6_config_data, ip6_mode_data, mnp_config_data, snp_mode_data);
lib/std/os/uefi/protocols/udp6_service_binding_protocol.zig+2-2
......@@ -4,8 +4,8 @@ const Guid = uefi.Guid;
44const Status = uefi.Status;
55
66pub const Udp6ServiceBindingProtocol = extern struct {
7 _create_child: extern fn (*const Udp6ServiceBindingProtocol, *?Handle) Status,
8 _destroy_child: extern fn (*const Udp6ServiceBindingProtocol, Handle) Status,
7 _create_child: fn (*const Udp6ServiceBindingProtocol, *?Handle) callconv(.C) Status,
8 _destroy_child: fn (*const Udp6ServiceBindingProtocol, Handle) callconv(.C) Status,
99
1010 pub fn createChild(self: *const Udp6ServiceBindingProtocol, handle: *?Handle) Status {
1111 return self._create_child(self, handle);
lib/std/os/uefi/tables/boot_services.zig+32-32
......@@ -21,117 +21,117 @@ pub const BootServices = extern struct {
2121 hdr: TableHeader,
2222
2323 /// Raises a task's priority level and returns its previous level.
24 raiseTpl: extern fn (usize) usize,
24 raiseTpl: fn (usize) callconv(.C) usize,
2525
2626 /// Restores a task's priority level to its previous value.
27 restoreTpl: extern fn (usize) void,
27 restoreTpl: fn (usize) callconv(.C) void,
2828
2929 /// Allocates memory pages from the system.
30 allocatePages: extern fn (AllocateType, MemoryType, usize, *[*]align(4096) u8) Status,
30 allocatePages: fn (AllocateType, MemoryType, usize, *[*]align(4096) u8) callconv(.C) Status,
3131
3232 /// Frees memory pages.
33 freePages: extern fn ([*]align(4096) u8, usize) Status,
33 freePages: fn ([*]align(4096) u8, usize) callconv(.C) Status,
3434
3535 /// Returns the current memory map.
36 getMemoryMap: extern fn (*usize, [*]MemoryDescriptor, *usize, *usize, *u32) Status,
36 getMemoryMap: fn (*usize, [*]MemoryDescriptor, *usize, *usize, *u32) callconv(.C) Status,
3737
3838 /// Allocates pool memory.
39 allocatePool: extern fn (MemoryType, usize, *[*]align(8) u8) Status,
39 allocatePool: fn (MemoryType, usize, *[*]align(8) u8) callconv(.C) Status,
4040
4141 /// Returns pool memory to the system.
42 freePool: extern fn ([*]align(8) u8) Status,
42 freePool: fn ([*]align(8) u8) callconv(.C) Status,
4343
4444 /// Creates an event.
45 createEvent: extern fn (u32, usize, ?extern fn (Event, ?*c_void) void, ?*const c_void, *Event) Status,
45 createEvent: fn (u32, usize, ?fn (Event, ?*c_void) callconv(.C) void, ?*const c_void, *Event) callconv(.C) Status,
4646
4747 /// Sets the type of timer and the trigger time for a timer event.
48 setTimer: extern fn (Event, TimerDelay, u64) Status,
48 setTimer: fn (Event, TimerDelay, u64) callconv(.C) Status,
4949
5050 /// Stops execution until an event is signaled.
51 waitForEvent: extern fn (usize, [*]const Event, *usize) Status,
51 waitForEvent: fn (usize, [*]const Event, *usize) callconv(.C) Status,
5252
5353 /// Signals an event.
54 signalEvent: extern fn (Event) Status,
54 signalEvent: fn (Event) callconv(.C) Status,
5555
5656 /// Closes an event.
57 closeEvent: extern fn (Event) Status,
57 closeEvent: fn (Event) callconv(.C) Status,
5858
5959 /// Checks whether an event is in the signaled state.
60 checkEvent: extern fn (Event) Status,
60 checkEvent: fn (Event) callconv(.C) Status,
6161
6262 installProtocolInterface: Status, // TODO
6363 reinstallProtocolInterface: Status, // TODO
6464 uninstallProtocolInterface: Status, // TODO
6565
6666 /// Queries a handle to determine if it supports a specified protocol.
67 handleProtocol: extern fn (Handle, *align(8) const Guid, *?*c_void) Status,
67 handleProtocol: fn (Handle, *align(8) const Guid, *?*c_void) callconv(.C) Status,
6868
6969 reserved: *c_void,
7070
7171 registerProtocolNotify: Status, // TODO
7272
7373 /// Returns an array of handles that support a specified protocol.
74 locateHandle: extern fn (LocateSearchType, ?*align(8) const Guid, ?*const c_void, *usize, [*]Handle) Status,
74 locateHandle: fn (LocateSearchType, ?*align(8) const Guid, ?*const c_void, *usize, [*]Handle) callconv(.C) Status,
7575
7676 locateDevicePath: Status, // TODO
7777 installConfigurationTable: Status, // TODO
7878
7979 /// Loads an EFI image into memory.
80 loadImage: extern fn (bool, Handle, ?*const DevicePathProtocol, ?[*]const u8, usize, *?Handle) Status,
80 loadImage: fn (bool, Handle, ?*const DevicePathProtocol, ?[*]const u8, usize, *?Handle) callconv(.C) Status,
8181
8282 /// Transfers control to a loaded image's entry point.
83 startImage: extern fn (Handle, ?*usize, ?*[*]u16) Status,
83 startImage: fn (Handle, ?*usize, ?*[*]u16) callconv(.C) Status,
8484
8585 /// Terminates a loaded EFI image and returns control to boot services.
86 exit: extern fn (Handle, Status, usize, ?*const c_void) Status,
86 exit: fn (Handle, Status, usize, ?*const c_void) callconv(.C) Status,
8787
8888 /// Unloads an image.
89 unloadImage: extern fn (Handle) Status,
89 unloadImage: fn (Handle) callconv(.C) Status,
9090
9191 /// Terminates all boot services.
92 exitBootServices: extern fn (Handle, usize) Status,
92 exitBootServices: fn (Handle, usize) callconv(.C) Status,
9393
9494 /// Returns a monotonically increasing count for the platform.
95 getNextMonotonicCount: extern fn (*u64) Status,
95 getNextMonotonicCount: fn (*u64) callconv(.C) Status,
9696
9797 /// Induces a fine-grained stall.
98 stall: extern fn (usize) Status,
98 stall: fn (usize) callconv(.C) Status,
9999
100100 /// Sets the system's watchdog timer.
101 setWatchdogTimer: extern fn (usize, u64, usize, ?[*]const u16) Status,
101 setWatchdogTimer: fn (usize, u64, usize, ?[*]const u16) callconv(.C) Status,
102102
103103 connectController: Status, // TODO
104104 disconnectController: Status, // TODO
105105
106106 /// Queries a handle to determine if it supports a specified protocol.
107 openProtocol: extern fn (Handle, *align(8) const Guid, *?*c_void, ?Handle, ?Handle, OpenProtocolAttributes) Status,
107 openProtocol: fn (Handle, *align(8) const Guid, *?*c_void, ?Handle, ?Handle, OpenProtocolAttributes) callconv(.C) Status,
108108
109109 /// Closes a protocol on a handle that was opened using openProtocol().
110 closeProtocol: extern fn (Handle, *align(8) const Guid, Handle, ?Handle) Status,
110 closeProtocol: fn (Handle, *align(8) const Guid, Handle, ?Handle) callconv(.C) Status,
111111
112112 /// Retrieves the list of agents that currently have a protocol interface opened.
113 openProtocolInformation: extern fn (Handle, *align(8) const Guid, *[*]ProtocolInformationEntry, *usize) Status,
113 openProtocolInformation: fn (Handle, *align(8) const Guid, *[*]ProtocolInformationEntry, *usize) callconv(.C) Status,
114114
115115 /// Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated from pool.
116 protocolsPerHandle: extern fn (Handle, *[*]*align(8) const Guid, *usize) Status,
116 protocolsPerHandle: fn (Handle, *[*]*align(8) const Guid, *usize) callconv(.C) Status,
117117
118118 /// Returns an array of handles that support the requested protocol in a buffer allocated from pool.
119 locateHandleBuffer: extern fn (LocateSearchType, ?*align(8) const Guid, ?*const c_void, *usize, *[*]Handle) Status,
119 locateHandleBuffer: fn (LocateSearchType, ?*align(8) const Guid, ?*const c_void, *usize, *[*]Handle) callconv(.C) Status,
120120
121121 /// Returns the first protocol instance that matches the given protocol.
122 locateProtocol: extern fn (*align(8) const Guid, ?*const c_void, *?*c_void) Status,
122 locateProtocol: fn (*align(8) const Guid, ?*const c_void, *?*c_void) callconv(.C) Status,
123123
124124 installMultipleProtocolInterfaces: Status, // TODO
125125 uninstallMultipleProtocolInterfaces: Status, // TODO
126126
127127 /// Computes and returns a 32-bit CRC for a data buffer.
128 calculateCrc32: extern fn ([*]const u8, usize, *u32) Status,
128 calculateCrc32: fn ([*]const u8, usize, *u32) callconv(.C) Status,
129129
130130 /// Copies the contents of one buffer to another buffer
131 copyMem: extern fn ([*]u8, [*]const u8, usize) void,
131 copyMem: fn ([*]u8, [*]const u8, usize) callconv(.C) void,
132132
133133 /// Fills a buffer with a specified value
134 setMem: extern fn ([*]u8, usize, u8) void,
134 setMem: fn ([*]u8, usize, u8) callconv(.C) void,
135135
136136 createEventEx: Status, // TODO
137137
lib/std/os/uefi/tables/runtime_services.zig+5-5
......@@ -17,7 +17,7 @@ pub const RuntimeServices = extern struct {
1717 hdr: TableHeader,
1818
1919 /// Returns the current time and date information, and the time-keeping capabilities of the hardware platform.
20 getTime: extern fn (*uefi.Time, ?*TimeCapabilities) Status,
20 getTime: fn (*uefi.Time, ?*TimeCapabilities) callconv(.C) Status,
2121
2222 setTime: Status, // TODO
2323 getWakeupTime: Status, // TODO
......@@ -26,18 +26,18 @@ pub const RuntimeServices = extern struct {
2626 convertPointer: Status, // TODO
2727
2828 /// Returns the value of a variable.
29 getVariable: extern fn ([*:0]const u16, *align(8) const Guid, ?*u32, *usize, ?*c_void) Status,
29 getVariable: fn ([*:0]const u16, *align(8) const Guid, ?*u32, *usize, ?*c_void) callconv(.C) Status,
3030
3131 /// Enumerates the current variable names.
32 getNextVariableName: extern fn (*usize, [*:0]u16, *align(8) Guid) Status,
32 getNextVariableName: fn (*usize, [*:0]u16, *align(8) Guid) callconv(.C) Status,
3333
3434 /// Sets the value of a variable.
35 setVariable: extern fn ([*:0]const u16, *align(8) const Guid, u32, usize, *c_void) Status,
35 setVariable: fn ([*:0]const u16, *align(8) const Guid, u32, usize, *c_void) callconv(.C) Status,
3636
3737 getNextHighMonotonicCount: Status, // TODO
3838
3939 /// Resets the entire platform.
40 resetSystem: extern fn (ResetType, Status, usize, ?*const c_void) noreturn,
40 resetSystem: fn (ResetType, Status, usize, ?*const c_void) callconv(.C) noreturn,
4141
4242 updateCapsule: Status, // TODO
4343 queryCapsuleCapabilities: Status, // TODO
lib/std/os/windows/bits.zig+6-6
......@@ -627,7 +627,7 @@ pub const MEM_RESERVE_PLACEHOLDERS = 0x2;
627627pub const MEM_DECOMMIT = 0x4000;
628628pub const MEM_RELEASE = 0x8000;
629629
630pub const PTHREAD_START_ROUTINE = extern fn (LPVOID) DWORD;
630pub const PTHREAD_START_ROUTINE = fn (LPVOID) callconv(.C) DWORD;
631631pub const LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE;
632632
633633pub const WIN32_FIND_DATAW = extern struct {
......@@ -784,7 +784,7 @@ pub const IMAGE_TLS_DIRECTORY = extern struct {
784784pub const IMAGE_TLS_DIRECTORY64 = IMAGE_TLS_DIRECTORY;
785785pub const IMAGE_TLS_DIRECTORY32 = IMAGE_TLS_DIRECTORY;
786786
787pub const PIMAGE_TLS_CALLBACK = ?extern fn (PVOID, DWORD, PVOID) void;
787pub const PIMAGE_TLS_CALLBACK = ?fn (PVOID, DWORD, PVOID) callconv(.C) void;
788788
789789pub const PROV_RSA_FULL = 1;
790790
......@@ -810,7 +810,7 @@ pub const FILE_ACTION_MODIFIED = 0x00000003;
810810pub const FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;
811811pub const FILE_ACTION_RENAMED_NEW_NAME = 0x00000005;
812812
813pub const LPOVERLAPPED_COMPLETION_ROUTINE = ?extern fn (DWORD, DWORD, *OVERLAPPED) void;
813pub const LPOVERLAPPED_COMPLETION_ROUTINE = ?fn (DWORD, DWORD, *OVERLAPPED) callconv(.C) void;
814814
815815pub const FILE_NOTIFY_CHANGE_CREATION = 64;
816816pub const FILE_NOTIFY_CHANGE_SIZE = 8;
......@@ -863,7 +863,7 @@ pub const RTL_CRITICAL_SECTION = extern struct {
863863pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION;
864864pub const INIT_ONCE = RTL_RUN_ONCE;
865865pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE_INIT;
866pub const INIT_ONCE_FN = extern fn (InitOnce: *INIT_ONCE, Parameter: ?*c_void, Context: ?*c_void) BOOL;
866pub const INIT_ONCE_FN = fn (InitOnce: *INIT_ONCE, Parameter: ?*c_void, Context: ?*c_void) callconv(.C) BOOL;
867867
868868pub const RTL_RUN_ONCE = extern struct {
869869 Ptr: ?*c_void,
......@@ -1418,7 +1418,7 @@ pub const RTL_DRIVE_LETTER_CURDIR = extern struct {
14181418 DosPath: UNICODE_STRING,
14191419};
14201420
1421pub const PPS_POST_PROCESS_INIT_ROUTINE = ?extern fn () void;
1421pub const PPS_POST_PROCESS_INIT_ROUTINE = ?fn () callconv(.C) void;
14221422
14231423pub const FILE_BOTH_DIR_INFORMATION = extern struct {
14241424 NextEntryOffset: ULONG,
......@@ -1438,7 +1438,7 @@ pub const FILE_BOTH_DIR_INFORMATION = extern struct {
14381438};
14391439pub const FILE_BOTH_DIRECTORY_INFORMATION = FILE_BOTH_DIR_INFORMATION;
14401440
1441pub const IO_APC_ROUTINE = extern fn (PVOID, *IO_STATUS_BLOCK, ULONG) void;
1441pub const IO_APC_ROUTINE = fn (PVOID, *IO_STATUS_BLOCK, ULONG) callconv(.C) void;
14421442
14431443pub const CURDIR = extern struct {
14441444 DosPath: UNICODE_STRING,
lib/std/os/windows/ws2_32.zig+1-1
......@@ -106,7 +106,7 @@ pub const WSAOVERLAPPED = extern struct {
106106 hEvent: ?WSAEVENT,
107107};
108108
109pub const WSAOVERLAPPED_COMPLETION_ROUTINE = extern fn (dwError: DWORD, cbTransferred: DWORD, lpOverlapped: *WSAOVERLAPPED, dwFlags: DWORD) void;
109pub const WSAOVERLAPPED_COMPLETION_ROUTINE = fn (dwError: DWORD, cbTransferred: DWORD, lpOverlapped: *WSAOVERLAPPED, dwFlags: DWORD) callconv(.C) void;
110110
111111pub const ADDRESS_FAMILY = u16;
112112
lib/std/special/test_runner.zig+1-1
......@@ -34,7 +34,7 @@ pub fn main() anyerror!void {
3434 std.heap.page_allocator.free(async_frame_buffer);
3535 async_frame_buffer = try std.heap.page_allocator.alignedAlloc(u8, std.Target.stack_align, size);
3636 }
37 const casted_fn = @ptrCast(async fn () anyerror!void, test_fn.func);
37 const casted_fn = @ptrCast(fn () callconv(.Async) anyerror!void, test_fn.func);
3838 break :blk await @asyncCall(async_frame_buffer, {}, casted_fn);
3939 },
4040 .blocking => {
lib/std/start.zig+1-2
......@@ -224,8 +224,7 @@ inline fn initEventLoopAndCallMain() u8 {
224224 // and we want fewer call frames in stack traces.
225225 return @call(.{ .modifier = .always_inline }, callMain, .{});
226226}
227
228async fn callMainAsync(loop: *std.event.Loop) u8 {
227fn callMainAsync(loop: *std.event.Loop) callconv(.Async) u8 {
229228 // This prevents the event loop from terminating at least until main() has returned.
230229 loop.beginOneEvent();
231230 defer loop.finishOneEvent();
src-self-hosted/clang.zig+1-1
......@@ -781,7 +781,7 @@ pub extern fn ZigClangSourceManager_getCharacterData(self: ?*const struct_ZigCla
781781pub extern fn ZigClangASTContext_getPointerType(self: ?*const struct_ZigClangASTContext, T: struct_ZigClangQualType) struct_ZigClangQualType;
782782pub extern fn ZigClangASTUnit_getASTContext(self: ?*struct_ZigClangASTUnit) ?*struct_ZigClangASTContext;
783783pub extern fn ZigClangASTUnit_getSourceManager(self: *struct_ZigClangASTUnit) *struct_ZigClangSourceManager;
784pub extern fn ZigClangASTUnit_visitLocalTopLevelDecls(self: *struct_ZigClangASTUnit, context: ?*c_void, Fn: ?extern fn (?*c_void, *const struct_ZigClangDecl) bool) bool;
784pub extern fn ZigClangASTUnit_visitLocalTopLevelDecls(self: *struct_ZigClangASTUnit, context: ?*c_void, Fn: ?fn (?*c_void, *const struct_ZigClangDecl) callconv(.C) bool) bool;
785785pub extern fn ZigClangRecordType_getDecl(record_ty: ?*const struct_ZigClangRecordType) *const struct_ZigClangRecordDecl;
786786pub extern fn ZigClangTagDecl_isThisDeclarationADefinition(self: *const ZigClangTagDecl) bool;
787787pub extern fn ZigClangEnumType_getDecl(record_ty: ?*const struct_ZigClangEnumType) *const struct_ZigClangEnumDecl;
src-self-hosted/main.zig+2-3
......@@ -41,7 +41,7 @@ const usage =
4141
4242const Command = struct {
4343 name: []const u8,
44 exec: async fn (*Allocator, []const []const u8) anyerror!void,
44 exec: fn (*Allocator, []const []const u8) callconv(.Async) anyerror!void,
4545};
4646
4747pub fn main() !void {
......@@ -713,8 +713,7 @@ const FmtError = error{
713713 FileBusy,
714714 CurrentWorkingDirectoryUnlinked,
715715} || fs.File.OpenError;
716
717async fn fmtPath(fmt: *Fmt, file_path_ref: []const u8, check_mode: bool) FmtError!void {
716fn fmtPath(fmt: *Fmt, file_path_ref: []const u8, check_mode: bool) callconv(.Async) FmtError!void {
718717 const stderr_file = io.getStdErr();
719718 const stderr = stderr_file.outStream();
720719
test/stage1/behavior/async_fn.zig+25-29
......@@ -112,12 +112,12 @@ test "@frameSize" {
112112 const S = struct {
113113 fn doTheTest() void {
114114 {
115 var ptr = @ptrCast(async fn (i32) void, other);
115 var ptr = @ptrCast(fn (i32) callconv(.Async) void, other);
116116 const size = @frameSize(ptr);
117117 expect(size == @sizeOf(@Frame(other)));
118118 }
119119 {
120 var ptr = @ptrCast(async fn () void, first);
120 var ptr = @ptrCast(fn () callconv(.Async) void, first);
121121 const size = @frameSize(ptr);
122122 expect(size == @sizeOf(@Frame(first)));
123123 }
......@@ -184,7 +184,7 @@ test "coroutine suspend with block" {
184184
185185var a_promise: anyframe = undefined;
186186var global_result = false;
187async fn testSuspendBlock() void {
187fn testSuspendBlock() callconv(.Async) void {
188188 suspend {
189189 comptime expect(@TypeOf(@frame()) == *@Frame(testSuspendBlock));
190190 a_promise = @frame();
......@@ -209,14 +209,14 @@ test "coroutine await" {
209209 expect(await_final_result == 1234);
210210 expect(std.mem.eql(u8, &await_points, "abcdefghi"));
211211}
212async fn await_amain() void {
212fn await_amain() callconv(.Async) void {
213213 await_seq('b');
214214 var p = async await_another();
215215 await_seq('e');
216216 await_final_result = await p;
217217 await_seq('h');
218218}
219async fn await_another() i32 {
219fn await_another() callconv(.Async) i32 {
220220 await_seq('c');
221221 suspend {
222222 await_seq('d');
......@@ -243,14 +243,14 @@ test "coroutine await early return" {
243243 expect(early_final_result == 1234);
244244 expect(std.mem.eql(u8, &early_points, "abcdef"));
245245}
246async fn early_amain() void {
246fn early_amain() callconv(.Async) void {
247247 early_seq('b');
248248 var p = async early_another();
249249 early_seq('d');
250250 early_final_result = await p;
251251 early_seq('e');
252252}
253async fn early_another() i32 {
253fn early_another() callconv(.Async) i32 {
254254 early_seq('c');
255255 return 1234;
256256}
......@@ -266,7 +266,7 @@ fn early_seq(c: u8) void {
266266test "async function with dot syntax" {
267267 const S = struct {
268268 var y: i32 = 1;
269 async fn foo() void {
269 fn foo() callconv(.Async) void {
270270 y += 1;
271271 suspend;
272272 }
......@@ -278,7 +278,7 @@ test "async function with dot syntax" {
278278test "async fn pointer in a struct field" {
279279 var data: i32 = 1;
280280 const Foo = struct {
281 bar: async fn (*i32) void,
281 bar: fn (*i32) callconv(.Async) void,
282282 };
283283 var foo = Foo{ .bar = simpleAsyncFn2 };
284284 var bytes: [64]u8 align(16) = undefined;
......@@ -294,8 +294,7 @@ test "async fn pointer in a struct field" {
294294fn doTheAwait(f: anyframe->void) void {
295295 await f;
296296}
297
298async fn simpleAsyncFn2(y: *i32) void {
297fn simpleAsyncFn2(y: *i32) callconv(.Async) void {
299298 defer y.* += 2;
300299 y.* += 1;
301300 suspend;
......@@ -303,11 +302,10 @@ async fn simpleAsyncFn2(y: *i32) void {
303302
304303test "@asyncCall with return type" {
305304 const Foo = struct {
306 bar: async fn () i32,
305 bar: fn () callconv(.Async) i32,
307306
308307 var global_frame: anyframe = undefined;
309
310 async fn middle() i32 {
308 fn middle() callconv(.Async) i32 {
311309 return afunc();
312310 }
313311
......@@ -338,8 +336,7 @@ test "async fn with inferred error set" {
338336 resume global_frame;
339337 std.testing.expectError(error.Fail, result);
340338 }
341
342 async fn middle() !void {
339 fn middle() callconv(.Async) !void {
343340 var f = async middle2();
344341 return await f;
345342 }
......@@ -376,11 +373,11 @@ fn nonFailing() (anyframe->anyerror!void) {
376373 Static.frame = async suspendThenFail();
377374 return &Static.frame;
378375}
379async fn suspendThenFail() anyerror!void {
376fn suspendThenFail() callconv(.Async) anyerror!void {
380377 suspend;
381378 return error.Fail;
382379}
383async fn printTrace(p: anyframe->(anyerror!void)) void {
380fn printTrace(p: anyframe->(anyerror!void)) callconv(.Async) void {
384381 (await p) catch |e| {
385382 std.testing.expect(e == error.Fail);
386383 if (@errorReturnTrace()) |trace| {
......@@ -397,7 +394,7 @@ test "break from suspend" {
397394 const p = async testBreakFromSuspend(&my_result);
398395 std.testing.expect(my_result == 2);
399396}
400async fn testBreakFromSuspend(my_result: *i32) void {
397fn testBreakFromSuspend(my_result: *i32) callconv(.Async) void {
401398 suspend {
402399 resume @frame();
403400 }
......@@ -826,7 +823,7 @@ test "cast fn to async fn when it is inferred to be async" {
826823 var ok = false;
827824
828825 fn doTheTest() void {
829 var ptr: async fn () i32 = undefined;
826 var ptr: fn () callconv(.Async) i32 = undefined;
830827 ptr = func;
831828 var buf: [100]u8 align(16) = undefined;
832829 var result: i32 = undefined;
......@@ -854,7 +851,7 @@ test "cast fn to async fn when it is inferred to be async, awaited directly" {
854851 var ok = false;
855852
856853 fn doTheTest() void {
857 var ptr: async fn () i32 = undefined;
854 var ptr: fn () callconv(.Async) i32 = undefined;
858855 ptr = func;
859856 var buf: [100]u8 align(16) = undefined;
860857 var result: i32 = undefined;
......@@ -958,8 +955,7 @@ test "@asyncCall with comptime-known function, but not awaited directly" {
958955 resume global_frame;
959956 std.testing.expectError(error.Fail, result);
960957 }
961
962 async fn middle() !void {
958 fn middle() callconv(.Async) !void {
963959 var f = async middle2();
964960 return await f;
965961 }
......@@ -993,7 +989,7 @@ test "@asyncCall with actual frame instead of byte buffer" {
993989
994990test "@asyncCall using the result location inside the frame" {
995991 const S = struct {
996 async fn simple2(y: *i32) i32 {
992 fn simple2(y: *i32) callconv(.Async) i32 {
997993 defer y.* += 2;
998994 y.* += 1;
999995 suspend;
......@@ -1005,7 +1001,7 @@ test "@asyncCall using the result location inside the frame" {
10051001 };
10061002 var data: i32 = 1;
10071003 const Foo = struct {
1008 bar: async fn (*i32) i32,
1004 bar: fn (*i32) callconv(.Async) i32,
10091005 };
10101006 var foo = Foo{ .bar = S.simple2 };
10111007 var bytes: [64]u8 align(16) = undefined;
......@@ -1115,7 +1111,7 @@ test "await used in expression and awaiting fn with no suspend but async calling
11151111 const sum = (await f1) + (await f2);
11161112 expect(sum == 10);
11171113 }
1118 async fn add(a: i32, b: i32) i32 {
1114 fn add(a: i32, b: i32) callconv(.Async) i32 {
11191115 return a + b;
11201116 }
11211117 };
......@@ -1130,7 +1126,7 @@ test "await used in expression after a fn call" {
11301126 sum = foo() + await f1;
11311127 expect(sum == 8);
11321128 }
1133 async fn add(a: i32, b: i32) i32 {
1129 fn add(a: i32, b: i32) callconv(.Async) i32 {
11341130 return a + b;
11351131 }
11361132 fn foo() i32 {
......@@ -1147,7 +1143,7 @@ test "async fn call used in expression after a fn call" {
11471143 sum = foo() + add(3, 4);
11481144 expect(sum == 8);
11491145 }
1150 async fn add(a: i32, b: i32) i32 {
1146 fn add(a: i32, b: i32) callconv(.Async) i32 {
11511147 return a + b;
11521148 }
11531149 fn foo() i32 {
......@@ -1403,7 +1399,7 @@ test "async function call resolves target fn frame, runtime func" {
14031399 fn foo() anyerror!void {
14041400 const stack_size = 1000;
14051401 var stack_frame: [stack_size]u8 align(std.Target.stack_align) = undefined;
1406 var func: async fn () anyerror!void = bar;
1402 var func: fn () callconv(.Async) anyerror!void = bar;
14071403 return await @asyncCall(&stack_frame, {}, func);
14081404 }
14091405
test/stage1/behavior/await_struct.zig+2-2
......@@ -18,14 +18,14 @@ test "coroutine await struct" {
1818 expect(await_final_result.x == 1234);
1919 expect(std.mem.eql(u8, &await_points, "abcdefghi"));
2020}
21async fn await_amain() void {
21fn await_amain() callconv(.Async) void {
2222 await_seq('b');
2323 var p = async await_another();
2424 await_seq('e');
2525 await_final_result = await p;
2626 await_seq('h');
2727}
28async fn await_another() Foo {
28fn await_another() callconv(.Async) Foo {
2929 await_seq('c');
3030 suspend {
3131 await_seq('d');
test/stage1/behavior/cast.zig+1-1
......@@ -762,7 +762,7 @@ test "variable initialization uses result locations properly with regards to the
762762
763763test "cast between [*c]T and ?[*:0]T on fn parameter" {
764764 const S = struct {
765 const Handler = ?extern fn ([*c]const u8) void;
765 const Handler = ?fn ([*c]const u8) callconv(.C) void;
766766 fn addCallback(handler: Handler) void {}
767767
768768 fn myCallback(cstr: ?[*:0]const u8) callconv(.C) void {}