From ce8968fa375740828dbecb771347f45e8be29693 Mon Sep 17 00:00:00 2001 From: Don Park Date: Tue, 9 Jul 2024 07:23:03 +0700 Subject: [PATCH] posix --- build.zig | 4 ++++ src/main.zig | 2 +- src/simple_buffer.zig | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index 34e5c05..8891973 100644 --- a/build.zig +++ b/build.zig @@ -15,6 +15,8 @@ pub fn build(b: *std.Build) void { // set a preferred release mode, allowing the user to decide how to optimize. const optimize = b.standardOptimizeOption(.{}); + // const module = b.addModule("curl", .{}); + // module.addIncludePath( .{ .src_path = .{ .sub_path = "/usr/include/x86_64-linux-gnu", .owner = b } }); // const lib = b.addStaticLibrary(.{ // .name = "zootdeck", // // In this case the main source file is merely a path, however, in more @@ -36,6 +38,8 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); exe.linkLibC(); + exe.addIncludePath(.{ .src_path = .{ .sub_path = "/usr/include/x86_64-linux-gnu", .owner = b } }); + exe.addIncludePath(.{ .cwd_relative = "." }); // This declares intent for the executable to be installed into the // standard location when the user invokes the "install" step (the default diff --git a/src/main.zig b/src/main.zig index c8fa002..feab007 100644 --- a/src/main.zig +++ b/src/main.zig @@ -404,7 +404,7 @@ fn guiback(command: *thread.Command) void { } if (command.id == 11) { // Quit warn("byebye...\n", .{}); - std.os.exit(0); + std.posix.exit(0); } } diff --git a/src/simple_buffer.zig b/src/simple_buffer.zig index 1c9a544..e4375c3 100644 --- a/src/simple_buffer.zig +++ b/src/simple_buffer.zig @@ -24,7 +24,7 @@ pub const SimpleU8 = struct { pub fn append(self: *SimpleU8, m: []const u8) !void { const old_len = self.len(); try self.resize(old_len + m.len); - std.mem.copy(u8, self.list.items[old_len..], m); + std.mem.copyForwards(u8, self.list.items[old_len..], m); } pub fn appendByte(self: *SimpleU8, byte: u8) !void {