mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
more zig 15 fixes
This commit is contained in:
parent
6f5c655bf9
commit
54c00d429b
3 changed files with 13 additions and 13 deletions
|
|
@ -1935,7 +1935,7 @@ pub fn rocBundle(gpa: Allocator, args: cli_args.BundleArgs) !void {
|
|||
&iter,
|
||||
@intCast(args.compression_level),
|
||||
&allocator_copy,
|
||||
temp_file.writer(),
|
||||
temp_file.deprecatedWriter(),
|
||||
cwd,
|
||||
null, // path_prefix parameter - null means no stripping
|
||||
&error_ctx,
|
||||
|
|
@ -2027,7 +2027,7 @@ fn rocUnbundle(allocator: Allocator, args: cli_args.UnbundleArgs) !void {
|
|||
var error_ctx: unbundle.ErrorContext = undefined;
|
||||
unbundle.unbundleFiles(
|
||||
allocator,
|
||||
archive_file.reader(),
|
||||
archive_file.deprecatedReader(),
|
||||
output_dir,
|
||||
basename,
|
||||
&error_ctx,
|
||||
|
|
@ -2105,7 +2105,7 @@ fn rocBuild(gpa: Allocator, args: cli_args.BuildArgs) !void {
|
|||
std.log.info("Cross-compilation from {s} to {s} is supported", .{ @tagName(host_target), @tagName(target) });
|
||||
},
|
||||
.unsupported_host_target, .unsupported_cross_compilation, .missing_toolchain => {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
const stderr = std.fs.File.stderr().deprecatedWriter();
|
||||
try cross_compilation.printCrossCompilationError(stderr, cross_validation);
|
||||
std.process.exit(1);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ const LayoutStore = layout.Store;
|
|||
const TypeStore = types.store.Store;
|
||||
const CIR = can.CIR;
|
||||
|
||||
fn testRocAlloc(alloc_args: *RocAlloc, env: *anyopaque) callconv(.C) void {
|
||||
fn testRocAlloc(alloc_args: *RocAlloc, env: *anyopaque) callconv(.c) void {
|
||||
const test_env: *TestRunner = @ptrCast(@alignCast(env));
|
||||
const align_enum = std.mem.Alignment.fromByteUnits(@as(usize, @intCast(alloc_args.alignment)));
|
||||
const size_storage_bytes = @max(alloc_args.alignment, @alignOf(usize));
|
||||
|
|
@ -40,7 +40,7 @@ fn testRocAlloc(alloc_args: *RocAlloc, env: *anyopaque) callconv(.C) void {
|
|||
alloc_args.answer = @ptrFromInt(@intFromPtr(base_ptr) + size_storage_bytes);
|
||||
}
|
||||
|
||||
fn testRocDealloc(dealloc_args: *RocDealloc, env: *anyopaque) callconv(.C) void {
|
||||
fn testRocDealloc(dealloc_args: *RocDealloc, env: *anyopaque) callconv(.c) void {
|
||||
const test_env: *TestRunner = @ptrCast(@alignCast(env));
|
||||
const size_storage_bytes = @max(dealloc_args.alignment, @alignOf(usize));
|
||||
const size_ptr: *const usize = @ptrFromInt(@intFromPtr(dealloc_args.ptr) - @sizeOf(usize));
|
||||
|
|
@ -52,7 +52,7 @@ fn testRocDealloc(dealloc_args: *RocDealloc, env: *anyopaque) callconv(.C) void
|
|||
test_env.allocator.rawFree(slice, align_enum, @returnAddress());
|
||||
}
|
||||
|
||||
fn testRocRealloc(realloc_args: *RocRealloc, env: *anyopaque) callconv(.C) void {
|
||||
fn testRocRealloc(realloc_args: *RocRealloc, env: *anyopaque) callconv(.c) void {
|
||||
const test_env: *TestRunner = @ptrCast(@alignCast(env));
|
||||
const size_storage_bytes = @max(realloc_args.alignment, @alignOf(usize));
|
||||
const old_size_ptr: *const usize = @ptrFromInt(@intFromPtr(realloc_args.answer) - @sizeOf(usize));
|
||||
|
|
@ -68,19 +68,19 @@ fn testRocRealloc(realloc_args: *RocRealloc, env: *anyopaque) callconv(.C) void
|
|||
realloc_args.answer = @ptrFromInt(@intFromPtr(new_slice.ptr) + size_storage_bytes);
|
||||
}
|
||||
|
||||
fn testRocDbg(dbg_args: *const RocDbg, env: *anyopaque) callconv(.C) void {
|
||||
fn testRocDbg(dbg_args: *const RocDbg, env: *anyopaque) callconv(.c) void {
|
||||
_ = dbg_args;
|
||||
_ = env;
|
||||
@panic("testRocDbg not implemented yet");
|
||||
}
|
||||
|
||||
fn testRocExpectFailed(expect_args: *const RocExpectFailed, env: *anyopaque) callconv(.C) void {
|
||||
fn testRocExpectFailed(expect_args: *const RocExpectFailed, env: *anyopaque) callconv(.c) void {
|
||||
_ = expect_args;
|
||||
_ = env;
|
||||
@panic("testRocExpectFailed not implemented yet");
|
||||
}
|
||||
|
||||
fn testRocCrashed(crashed_args: *const RocCrashed, env: *anyopaque) callconv(.C) void {
|
||||
fn testRocCrashed(crashed_args: *const RocCrashed, env: *anyopaque) callconv(.c) void {
|
||||
const test_env: *TestRunner = @ptrCast(@alignCast(env));
|
||||
const msg_slice = crashed_args.utf8_bytes[0..crashed_args.len];
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ pub const TestRunner = struct {
|
|||
env: *const ModuleEnv,
|
||||
interpreter: Interpreter,
|
||||
roc_ops: ?RocOps,
|
||||
test_results: std.ArrayList(TestResult),
|
||||
test_results: std.array_list.Managed(TestResult),
|
||||
|
||||
pub fn init(
|
||||
allocator: std.mem.Allocator,
|
||||
|
|
@ -130,7 +130,7 @@ pub const TestRunner = struct {
|
|||
.env = cir,
|
||||
.interpreter = try Interpreter.init(allocator, cir, stack_memory, layout_cache, type_store),
|
||||
.roc_ops = null,
|
||||
.test_results = std.ArrayList(TestResult).init(allocator),
|
||||
.test_results = std.array_list.Managed(TestResult).init(allocator),
|
||||
};
|
||||
|
||||
return runner;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ fn readFileDefault(relative_path: []const u8, allocator: std.mem.Allocator) Read
|
|||
const file = try std.fs.cwd().openFile(relative_path, .{});
|
||||
defer file.close();
|
||||
|
||||
const contents = try file.reader().readAllAlloc(allocator, max_file_size);
|
||||
const contents = try file.deprecatedReader().readAllAlloc(allocator, max_file_size);
|
||||
|
||||
return contents;
|
||||
}
|
||||
|
|
@ -213,7 +213,7 @@ fn readFileIntoDefault(path: []const u8, buffer: []u8) ReadError!usize {
|
|||
const file = try std.fs.cwd().openFile(path, .{});
|
||||
defer file.close();
|
||||
|
||||
return try file.reader().readAll(buffer);
|
||||
return try file.deprecatedReader().readAll(buffer);
|
||||
}
|
||||
|
||||
fn openDirDefault(absolute_path: []const u8) OpenError!Dir {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue