From 2117b8108e89b307cc8c670b78ebd0bee86f704b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 25 Jan 2024 23:26:30 +0100 Subject: Fix build for latest zig --- build.zig | 4 ++-- depends/xcb-zig | 2 +- src/main.zig | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.zig b/build.zig index 63a7964..3af2642 100644 --- a/build.zig +++ b/build.zig @@ -9,6 +9,8 @@ pub fn build(b: *std.Build) void { .root_source_file = .{ .path = "src/main.zig" }, .target = target, .optimize = optimize, + .strip = optimize != std.builtin.OptimizeMode.Debug, + .single_threaded = true, }); const xcb_dep = b.anonymousDependency("depends/xcb-zig", @import("depends/xcb-zig/build.zig"), .{ @@ -17,9 +19,7 @@ pub fn build(b: *std.Build) void { }); exe.linkLibrary(xcb_dep.artifact("xcb-zig")); - exe.strip = optimize != std.builtin.OptimizeMode.Debug; exe.want_lto = optimize != std.builtin.OptimizeMode.Debug; - exe.single_threaded = true; b.installArtifact(exe); diff --git a/depends/xcb-zig b/depends/xcb-zig index 602bc79..1c449cc 160000 --- a/depends/xcb-zig +++ b/depends/xcb-zig @@ -1 +1 @@ -Subproject commit 602bc79e2461c45fde4703f70442cd17cb11d887 +Subproject commit 1c449ccd8c24d38e567f08ee20a350a1eea056dd diff --git a/src/main.zig b/src/main.zig index 2c30db5..366754b 100644 --- a/src/main.zig +++ b/src/main.zig @@ -15,13 +15,13 @@ pub fn main() !void { const screen: *c.xcb_screen_t = @ptrCast(c.xcb_setup_roots_iterator(c.xcb_get_setup(conn)).data); - var foreground = c.xcb_generate_id(conn); + const foreground = c.xcb_generate_id(conn); mask = c.XCB_GC_FOREGROUND | c.XCB_GC_GRAPHICS_EXPOSURES; values[0] = screen.black_pixel; values[1] = 0; _ = c.xcb_create_gc(conn, foreground, screen.root, mask, @ptrCast(&values)); - var background = c.xcb_generate_id(conn); + const background = c.xcb_generate_id(conn); mask = c.XCB_GC_BACKGROUND | c.XCB_GC_GRAPHICS_EXPOSURES; values[0] = screen.white_pixel; values[1] = 0; @@ -38,7 +38,7 @@ pub fn main() !void { _ = c.xcb_flush(conn); while (true) { - var e = c.xcb_wait_for_event(conn) orelse break; + const e = c.xcb_wait_for_event(conn) orelse break; defer std.c.free(e); switch (e.*.response_type & ~@as(u8, 0x80)) { c.XCB_EXPOSE => { -- cgit v1.2.3