Removed linux call_callback

This commit is contained in:
Jose Colon Rodriguez
2024-01-27 10:36:00 -04:00
parent 1e282e6d7c
commit f4f28a0f78

View File

@ -295,7 +295,7 @@ pub const IO = struct {
break :blk @as(os.socket_t, @intCast(completion.result)); break :blk @as(os.socket_t, @intCast(completion.result));
} }
}; };
call_callback(completion, &result); completion.callback(&result);
}, },
.close => { .close => {
const result: anyerror!void = blk: { const result: anyerror!void = blk: {
@ -313,7 +313,7 @@ pub const IO = struct {
assert(completion.result == 0); assert(completion.result == 0);
} }
}; };
call_callback(completion, &result); completion.callback(&result);
}, },
.connect => { .connect => {
const result: anyerror!void = blk: { const result: anyerror!void = blk: {
@ -347,7 +347,7 @@ pub const IO = struct {
assert(completion.result == 0); assert(completion.result == 0);
} }
}; };
call_callback(completion, &result); completion.callback(&result);
}, },
.read => { .read => {
const result: anyerror!usize = blk: { const result: anyerror!usize = blk: {
@ -377,7 +377,7 @@ pub const IO = struct {
break :blk @as(usize, @intCast(completion.result)); break :blk @as(usize, @intCast(completion.result));
} }
}; };
call_callback(completion, &result); completion.callback(&result);
}, },
.recv => { .recv => {
const result: anyerror!usize = blk: { const result: anyerror!usize = blk: {
@ -405,7 +405,7 @@ pub const IO = struct {
break :blk @as(usize, @intCast(completion.result)); break :blk @as(usize, @intCast(completion.result));
} }
}; };
call_callback(completion, &result); completion.callback(&result);
}, },
.send => { .send => {
const result: anyerror!usize = blk: { const result: anyerror!usize = blk: {
@ -440,7 +440,7 @@ pub const IO = struct {
break :blk @as(usize, @intCast(completion.result)); break :blk @as(usize, @intCast(completion.result));
} }
}; };
call_callback(completion, &result); completion.callback(&result);
}, },
.timeout => { .timeout => {
assert(completion.result < 0); assert(completion.result < 0);
@ -453,7 +453,7 @@ pub const IO = struct {
.TIME => {}, // A success. .TIME => {}, // A success.
else => |errno| os.unexpectedErrno(errno), else => |errno| os.unexpectedErrno(errno),
}; };
call_callback(completion, &result); completion.callback(&result);
}, },
.write => { .write => {
const result: anyerror!usize = blk: { const result: anyerror!usize = blk: {
@ -484,19 +484,12 @@ pub const IO = struct {
break :blk @as(usize, @intCast(completion.result)); break :blk @as(usize, @intCast(completion.result));
} }
}; };
call_callback(completion, &result); completion.callback(&result);
}, },
} }
} }
}; };
fn call_callback(
completion: *Completion,
result: *const anyopaque,
) void {
completion.callback(completion.context, completion, result);
}
/// This union encodes the set of operations supported as well as their arguments. /// This union encodes the set of operations supported as well as their arguments.
const Operation = union(enum) { const Operation = union(enum) {
accept: struct { accept: struct {