From 31e05ef1c2847221da4224aa0f7639061c068ef3 Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Fri, 7 Jun 2024 14:49:48 +0200 Subject: [PATCH] Ready for zig v0.13. --- build.zig | 8 ++++---- ipc.pc | 2 +- makefile | 2 +- src/exchange-fd.zig | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.zig b/build.zig index a8a5ce6..7d5a3a4 100644 --- a/build.zig +++ b/build.zig @@ -1,6 +1,6 @@ const std = @import("std"); -const VERSION = "0.1.1"; +const VERSION = "0.1.2"; // Although this function looks imperative, note that its job is to // declaratively construct a build graph that will be executed by an external @@ -21,7 +21,7 @@ pub fn build(b: *std.Build) void { .name = "ipc", // In this case the main source file is merely a path, however, in more // complicated build scripts, this could be a generated file. - .root_source_file = .{ .path = "src/bindings.zig" }, + .root_source_file = .{ .cwd_relative = "src/bindings.zig" }, .target = target, .optimize = optimize, }); @@ -37,7 +37,7 @@ pub fn build(b: *std.Build) void { const shared_lib = b.addSharedLibrary(.{ .name = "ipc", - .root_source_file = .{ .path = "src/bindings.zig" }, + .root_source_file = .{ .cwd_relative = "src/bindings.zig" }, .version = comptime (try std.SemanticVersion.parse(VERSION)), .target = target, .optimize = optimize, @@ -47,7 +47,7 @@ pub fn build(b: *std.Build) void { // Creates a step for unit testing. const main_tests = b.addTest(.{ - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = .{ .cwd_relative = "src/main.zig" }, .target = target, .optimize = optimize, }); diff --git a/ipc.pc b/ipc.pc index 6aaa656..efb4bea 100644 --- a/ipc.pc +++ b/ipc.pc @@ -3,6 +3,6 @@ libdir=/usr/local/lib Name: LibIPC Description: The simplest Inter Process Communication library -Version: 0.1.1 +Version: 0.1.2 Libs: -L${libdir} -lipc Cflags: -I${includedir} diff --git a/makefile b/makefile index d7dd312..7db1b37 100644 --- a/makefile +++ b/makefile @@ -48,7 +48,7 @@ serve-doc: darkhttpd docs/ --addr $(DOC_HTTPD_ADDR) --port $(DOC_HTTPD_PORT) --log $(DOC_HTTPD_ACCESS_LOGS) PACKAGE ?= libipc -VERSION ?= 0.1.0 +VERSION ?= 0.1.2 PKG = $(PACKAGE)-$(VERSION) dist-dir: [ -d $(PKG) ] || ln -s . $(PKG) diff --git a/src/exchange-fd.zig b/src/exchange-fd.zig index 1d9e997..7f1562a 100644 --- a/src/exchange-fd.zig +++ b/src/exchange-fd.zig @@ -78,8 +78,8 @@ test { pub fn send_fd(sockfd: posix.socket_t, msg: []const u8, fd: posix.fd_t) void { var iov = [_]posix.iovec_const{ .{ - .iov_base = msg.ptr, - .iov_len = msg.len, + .base = msg.ptr, + .len = msg.len, }, }; @@ -191,7 +191,7 @@ pub fn receive_fd(sockfd: posix.socket_t, buffer: []u8, msg_size: *usize) !posix var msg_buffer = [_]u8{0} ** 1500; var iov = [_]posix.iovec{ - .{ .iov_base = msg_buffer[0..], .iov_len = msg_buffer.len }, + .{ .base = msg_buffer[0..], .len = msg_buffer.len }, }; var cmsg = Cmsghdr(posix.fd_t).init(.{