mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 14:43:28 +00:00
upgrade to zig 0.13
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
zig-cache
|
||||
/.zig-cache/
|
||||
zig-out
|
||||
/vendor/netsurf/build/
|
||||
/vendor/netsurf/lib/
|
||||
|
||||
@@ -278,7 +278,7 @@ pub const Connection = struct {
|
||||
if (conn.read_end != conn.read_start) return;
|
||||
|
||||
var iovecs = [1]std.posix.iovec{
|
||||
.{ .iov_base = &conn.read_buf, .iov_len = conn.read_buf.len },
|
||||
.{ .base = &conn.read_buf, .len = conn.read_buf.len },
|
||||
};
|
||||
const nread = try conn.readvDirect(&iovecs);
|
||||
if (nread == 0) return error.EndOfStream;
|
||||
@@ -314,8 +314,8 @@ pub const Connection = struct {
|
||||
}
|
||||
|
||||
var iovecs = [2]std.posix.iovec{
|
||||
.{ .iov_base = buffer.ptr, .iov_len = buffer.len },
|
||||
.{ .iov_base = &conn.read_buf, .iov_len = conn.read_buf.len },
|
||||
.{ .base = buffer.ptr, .len = buffer.len },
|
||||
.{ .base = &conn.read_buf, .len = conn.read_buf.len },
|
||||
};
|
||||
const nread = try conn.readvDirect(&iovecs);
|
||||
|
||||
@@ -1560,7 +1560,7 @@ pub const RequestOptions = struct {
|
||||
};
|
||||
|
||||
fn validateUri(uri: Uri, arena: Allocator) !struct { Connection.Protocol, Uri } {
|
||||
const protocol_map = std.ComptimeStringMap(Connection.Protocol, .{
|
||||
const protocol_map = std.StaticStringMap(Connection.Protocol).initComptime(.{
|
||||
.{ "http", .plain },
|
||||
.{ "ws", .plain },
|
||||
.{ "https", .tls },
|
||||
|
||||
@@ -107,7 +107,7 @@ pub const Stream = struct {
|
||||
/// See equivalent function: `std.fs.File.writev`.
|
||||
pub fn writev(self: Stream, iovecs: []const posix.iovec_const) WriteError!usize {
|
||||
if (iovecs.len == 0) return 0;
|
||||
const first_buffer = iovecs[0].iov_base[0..iovecs[0].iov_len];
|
||||
const first_buffer = iovecs[0].base[0..iovecs[0].len];
|
||||
return try self.write(first_buffer);
|
||||
}
|
||||
|
||||
@@ -121,13 +121,13 @@ pub const Stream = struct {
|
||||
var i: usize = 0;
|
||||
while (true) {
|
||||
var amt = try self.writev(iovecs[i..]);
|
||||
while (amt >= iovecs[i].iov_len) {
|
||||
amt -= iovecs[i].iov_len;
|
||||
while (amt >= iovecs[i].len) {
|
||||
amt -= iovecs[i].len;
|
||||
i += 1;
|
||||
if (i >= iovecs.len) return;
|
||||
}
|
||||
iovecs[i].iov_base += amt;
|
||||
iovecs[i].iov_len -= amt;
|
||||
iovecs[i].base += amt;
|
||||
iovecs[i].len -= amt;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -288,7 +288,7 @@ fn runSafe(
|
||||
argv.appendAssumeCapacity(tc);
|
||||
defer _ = argv.pop();
|
||||
|
||||
const run = try std.ChildProcess.run(.{
|
||||
const run = try std.process.Child.run(.{
|
||||
.allocator = alloc,
|
||||
.argv = argv.items,
|
||||
.max_output_bytes = 1024 * 1024,
|
||||
|
||||
Reference in New Issue
Block a user