mirror of
https://github.com/zoriya/zig-wayland.git
synced 2026-06-02 02:45:15 +00:00
Bump zig requirement to 0.8.0
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# zig-wayland
|
||||
|
||||
Zig 0.7.1 bindings and protocol scanner for libwayland.
|
||||
Zig 0.8.0 bindings and protocol scanner for libwayland.
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ test "Fixed" {
|
||||
{
|
||||
const initial: f64 = 10.5301837;
|
||||
const val = Fixed.fromDouble(initial);
|
||||
try testing.expectApproxEqAbs(initial, val.toDouble(), 1 / 256.);
|
||||
try testing.expectApproxEqAbs(initial, val.toDouble(), 1.0 / 256.0);
|
||||
try testing.expectEqual(@as(i24, 10), val.toInt());
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -33,10 +33,10 @@ pub fn scan(root_dir: fs.Dir, out_path: []const u8, wayland_xml: []const u8, pro
|
||||
|
||||
var iter = scanner.client.iterator();
|
||||
while (iter.next()) |entry| {
|
||||
try writer.print("pub const {s} = struct {{", .{entry.key});
|
||||
if (mem.eql(u8, entry.key, "wl"))
|
||||
try writer.print("pub const {s} = struct {{", .{entry.key_ptr.*});
|
||||
if (mem.eql(u8, entry.key_ptr.*, "wl"))
|
||||
try writer.writeAll("pub usingnamespace @import(\"wayland_client_core.zig\");\n");
|
||||
for (entry.value.items) |generated_file|
|
||||
for (entry.value_ptr.items) |generated_file|
|
||||
try writer.print("pub usingnamespace @import(\"{s}\");", .{generated_file});
|
||||
try writer.writeAll("};\n");
|
||||
}
|
||||
@@ -53,10 +53,10 @@ pub fn scan(root_dir: fs.Dir, out_path: []const u8, wayland_xml: []const u8, pro
|
||||
|
||||
var iter = scanner.server.iterator();
|
||||
while (iter.next()) |entry| {
|
||||
try writer.print("pub const {s} = struct {{", .{entry.key});
|
||||
if (mem.eql(u8, entry.key, "wl"))
|
||||
try writer.print("pub const {s} = struct {{", .{entry.key_ptr.*});
|
||||
if (mem.eql(u8, entry.key_ptr.*, "wl"))
|
||||
try writer.writeAll("pub usingnamespace @import(\"wayland_server_core.zig\");\n");
|
||||
for (entry.value.items) |generated_file|
|
||||
for (entry.value_ptr.items) |generated_file|
|
||||
try writer.print("pub usingnamespace @import(\"{s}\");", .{generated_file});
|
||||
try writer.writeAll("};\n");
|
||||
}
|
||||
@@ -70,8 +70,8 @@ pub fn scan(root_dir: fs.Dir, out_path: []const u8, wayland_xml: []const u8, pro
|
||||
|
||||
var iter = scanner.common.iterator();
|
||||
while (iter.next()) |entry| {
|
||||
try writer.print("pub const {s} = struct {{", .{entry.key});
|
||||
for (entry.value.items) |generated_file|
|
||||
try writer.print("pub const {s} = struct {{", .{entry.key_ptr.*});
|
||||
for (entry.value_ptr.items) |generated_file|
|
||||
try writer.print("pub usingnamespace @import(\"{s}\");", .{generated_file});
|
||||
try writer.writeAll("};\n");
|
||||
}
|
||||
@@ -108,7 +108,7 @@ const Scanner = struct {
|
||||
const client_file = try out_dir.createFile(client_filename, .{});
|
||||
defer client_file.close();
|
||||
try protocol.emitClient(client_file.writer());
|
||||
try (try scanner.client.getOrPutValue(protocol_namespace, .{})).value.append(gpa, client_filename);
|
||||
try (try scanner.client.getOrPutValue(protocol_namespace, .{})).value_ptr.append(gpa, client_filename);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -116,7 +116,7 @@ const Scanner = struct {
|
||||
const server_file = try out_dir.createFile(server_filename, .{});
|
||||
defer server_file.close();
|
||||
try protocol.emitServer(server_file.writer());
|
||||
try (try scanner.server.getOrPutValue(protocol_namespace, .{})).value.append(gpa, server_filename);
|
||||
try (try scanner.server.getOrPutValue(protocol_namespace, .{})).value_ptr.append(gpa, server_filename);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -124,7 +124,7 @@ const Scanner = struct {
|
||||
const common_file = try out_dir.createFile(common_filename, .{});
|
||||
defer common_file.close();
|
||||
try protocol.emitCommon(common_file.writer());
|
||||
try (try scanner.common.getOrPutValue(protocol_namespace, .{})).value.append(gpa, common_filename);
|
||||
try (try scanner.common.getOrPutValue(protocol_namespace, .{})).value_ptr.append(gpa, common_filename);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user