mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
pkg/libuv: fix stage2 compilation issues
This commit is contained in:
@ -24,12 +24,16 @@ cond: Cond,
|
|||||||
ready: bool = false,
|
ready: bool = false,
|
||||||
terminate: BoolAtomic,
|
terminate: BoolAtomic,
|
||||||
sleeping: BoolAtomic,
|
sleeping: BoolAtomic,
|
||||||
callback: fn () void,
|
callback: std.meta.FnPtr(fn () void),
|
||||||
thread: ?Thread,
|
thread: ?Thread,
|
||||||
|
|
||||||
/// Initialize a new embedder. The callback is called when libuv should
|
/// Initialize a new embedder. The callback is called when libuv should
|
||||||
/// tick. The callback should be as fast as possible.
|
/// tick. The callback should be as fast as possible.
|
||||||
pub fn init(alloc: Allocator, loop: Loop, callback: fn () void) !Embed {
|
pub fn init(
|
||||||
|
alloc: Allocator,
|
||||||
|
loop: Loop,
|
||||||
|
callback: std.meta.FnPtr(fn () void),
|
||||||
|
) !Embed {
|
||||||
return Embed{
|
return Embed{
|
||||||
.loop = loop,
|
.loop = loop,
|
||||||
.mutex = try Mutex.init(alloc),
|
.mutex = try Mutex.init(alloc),
|
||||||
|
@ -96,10 +96,12 @@ pub fn Stream(comptime T: type) type {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (result) |slice| {
|
if (result) |slice| {
|
||||||
buf.* = @bitCast(c.uv_buf_t, slice);
|
buf.* = .{
|
||||||
|
.base = slice.ptr,
|
||||||
|
.len = slice.len,
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
buf.*.base = null;
|
buf.* = .{ .base = null, .len = 0 };
|
||||||
buf.*.len = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +114,7 @@ pub fn Stream(comptime T: type) type {
|
|||||||
@call(.{ .modifier = .always_inline }, read_cb, .{
|
@call(.{ .modifier = .always_inline }, read_cb, .{
|
||||||
¶m,
|
¶m,
|
||||||
cbnread,
|
cbnread,
|
||||||
@bitCast([]const u8, cbbuf.*),
|
cbbuf.*.base[0..cbbuf.*.len],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user