Skip to content

Commit

Permalink
Update for latest Zig master version
Browse files Browse the repository at this point in the history
  • Loading branch information
squeek502 committed Feb 29, 2024
1 parent 2614f0a commit 92ee69c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
submodules: true
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.12.0-dev.2818+97290e0bf
version: 0.12.0-dev.3074+ae7f3fc36
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os == 'windows-latest' }}
with:
Expand All @@ -47,7 +47,7 @@ jobs:

- name: Test 32-bit
if: ${{ matrix.os != 'macos-latest' }}
run: zig build test -Dtarget=x86-native
run: zig build test -Dtarget=x86-native

- name: Test big endian (mips)
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand Down
7 changes: 4 additions & 3 deletions src/auto_includes.zig
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ pub fn extractMingwIncludes(allocator: Allocator, maybe_progress: ?*std.Progress
resinator_cache_dir.deleteTree("include") catch {};

var in_stream = std.io.fixedBufferStream(compressed_mingw_includes);
var zstd_stream = std.compress.zstd.decompressStream(allocator, in_stream.reader());
defer zstd_stream.deinit();
const zstd_window = try allocator.alloc(u8, std.compress.zstd.DecompressorOptions.default_window_buffer_len);
defer allocator.free(zstd_window);
var zstd_stream = std.compress.zstd.decompressor(in_stream.reader(), .{ .window_buffer = zstd_window });

const uncompressed_tar = try zstd_stream.reader().readAllAlloc(allocator, std.math.maxInt(usize));
defer allocator.free(uncompressed_tar);
Expand All @@ -54,7 +55,7 @@ pub fn getCachePath(allocator: Allocator, appname: []const u8) error{OutOfMemory
.windows => {
const local_app_data = std.process.getEnvVarOwned(allocator, "LOCALAPPDATA") catch |err| switch (err) {
error.EnvironmentVariableNotFound => return null,
error.InvalidUtf8 => unreachable,
error.InvalidWtf8 => unreachable,
else => |e| return e,
};
defer allocator.free(local_app_data);
Expand Down

0 comments on commit 92ee69c

Please sign in to comment.