update cli test zig platform to zig 13

This commit is contained in:
Luke Boswell 2024-07-28 15:41:03 +10:00
parent 2be2c02b60
commit 164243821f
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
7 changed files with 37 additions and 37 deletions

View file

@ -1,6 +1,6 @@
const std = @import("std");
const builtin = @import("builtin");
const str = @import("glue").str;
const str = @import("glue/str.zig");
const RocStr = str.RocStr;
const testing = std.testing;
const expectEqual = testing.expectEqual;
@ -25,7 +25,7 @@ const DEBUG: bool = false;
export fn roc_alloc(size: usize, alignment: u32) callconv(.C) ?*anyopaque {
if (DEBUG) {
var ptr = malloc(size);
const ptr = malloc(size);
const stdout = std.io.getStdOut().writer();
stdout.print("alloc: {d} (alignment {d}, size {d})\n", .{ ptr, alignment, size }) catch unreachable;
return ptr;
@ -97,13 +97,13 @@ fn roc_mmap(addr: ?*anyopaque, length: c_uint, prot: c_int, flags: c_int, fd: c_
comptime {
if (builtin.os.tag == .macos or builtin.os.tag == .linux) {
@export(roc_getppid, .{ .name = "roc_getppid", .linkage = .Strong });
@export(roc_mmap, .{ .name = "roc_mmap", .linkage = .Strong });
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .Strong });
@export(roc_getppid, .{ .name = "roc_getppid", .linkage = .strong });
@export(roc_mmap, .{ .name = "roc_mmap", .linkage = .strong });
@export(roc_shm_open, .{ .name = "roc_shm_open", .linkage = .strong });
}
if (builtin.os.tag == .windows) {
@export(roc_getppid_windows_stub, .{ .name = "roc_getppid", .linkage = .Strong });
@export(roc_getppid_windows_stub, .{ .name = "roc_getppid", .linkage = .strong });
}
}