Skip to content

Commit c7821d9

Browse files
committed
Upgrade to latest Zig master
1 parent 6911f36 commit c7821d9

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Resoures can be anything, such as scripts, images, text, templates config files
1919
* An image in your own format that's able to display itself when executed
2020

2121
## Building the project
22-
*Last tested with Zig version 0.12.0-dev.3161+377ecc6af*
22+
To build with Zig 0.13, use the `zig-<version>` tag/release.
23+
To build with Zig master, use the main branch (last tested with Zig 0.14.0-dev.130+cb308ba3a)
2324

2425
`zig build` will put a `bin` and `lib` directory in your output folder (e.g. zig-out)
2526

build.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub fn build(b: *std.Build) void {
77

88
const lib = b.addStaticLibrary(.{
99
.name = "stitch",
10-
.root_source_file = .{ .path = "src/lib.zig" },
10+
.root_source_file = b.path("src/lib.zig"),
1111
.target = target,
1212
.optimize = optimize,
1313
});
@@ -18,7 +18,7 @@ pub fn build(b: *std.Build) void {
1818

1919
const exe = b.addExecutable(.{
2020
.name = "stitch",
21-
.root_source_file = .{ .path = "src/main.zig" },
21+
.root_source_file = b.path("src/main.zig"),
2222
.target = target,
2323
.optimize = optimize,
2424
});
@@ -34,7 +34,7 @@ pub fn build(b: *std.Build) void {
3434

3535
// Creates a step for unit testing.
3636
const main_tests = b.addTest(.{
37-
.root_source_file = .{ .path = "src/tests.zig" },
37+
.root_source_file = b.path("src/tests.zig"),
3838
.target = target,
3939
.optimize = optimize,
4040
});

src/lib.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,9 +686,9 @@ pub fn testTeardown() void {
686686
// Create a cryptographically unique filename; mostly useful for test purposes
687687
pub fn generateUniqueFileName(allocator: std.mem.Allocator) ![]const u8 {
688688
var output: [16]u8 = undefined;
689-
var secret_seed: [std.rand.DefaultCsprng.secret_seed_length]u8 = undefined;
689+
var secret_seed: [std.Random.DefaultCsprng.secret_seed_length]u8 = undefined;
690690
std.crypto.random.bytes(&secret_seed);
691-
var csprng = std.rand.DefaultCsprng.init(secret_seed);
691+
var csprng = std.Random.DefaultCsprng.init(secret_seed);
692692
const random = csprng.random();
693693
random.bytes(&output);
694694

src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub const Cmdline = struct {
111111
}
112112
} else {
113113
// The filename is stored in the index, so it can be found by name. By using name=path, an alternative name can be given
114-
var it = std.mem.split(u8, arg, "=");
114+
var it = std.mem.splitScalar(u8, arg, '=');
115115
var name = it.next();
116116
const second = it.next();
117117
const path = if (second != null) second.? else name.?;

0 commit comments

Comments
 (0)