mirror of
https://codeberg.org/ziglings/exercises.git
synced 2024-12-25 09:10:26 +00:00
Updated for dev pre-release build v0.9.0-dev.1343
A change in the "build" library imports and some cleanup in the patches.
This commit is contained in:
parent
cd2f9b8007
commit
0ba79fe869
3 changed files with 6 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const Builder = std.build.Builder;
|
||||
const Step = std.build.Step;
|
||||
const assert = std.debug.assert;
|
||||
|
@ -447,11 +448,11 @@ const exercises = [_]Exercise{
|
|||
/// Check the zig version to make sure it can compile the examples properly.
|
||||
/// This will compile with Zig 0.6.0 and later.
|
||||
fn checkVersion() bool {
|
||||
if (!@hasDecl(std.builtin, "zig_version")) {
|
||||
if (!@hasDecl(builtin, "zig_version")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const version = std.builtin.zig_version;
|
||||
const version = builtin.zig_version;
|
||||
const order = version.order(needed_version);
|
||||
return order != .lt;
|
||||
}
|
||||
|
@ -490,7 +491,7 @@ pub fn build(b: *Builder) void {
|
|||
.auto => {
|
||||
if (std.io.getStdErr().supportsAnsiEscapeCodes()) {
|
||||
use_color_escapes = true;
|
||||
} else if (std.builtin.os.tag == .windows) {
|
||||
} else if (builtin.os.tag == .windows) {
|
||||
const w32 = struct {
|
||||
const WINAPI = std.os.windows.WINAPI;
|
||||
const DWORD = std.os.windows.DWORD;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
62c62,68
|
||||
< return detectProblems(n) ???
|
||||
< return detectProblems(n) ???;
|
||||
---
|
||||
> return detectProblems(n) catch |err| {
|
||||
> if (err == MyNumberError.TooSmall) {
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
35a36
|
||||
41a42
|
||||
> MyNumberError.TooSmall => std.debug.print("<4. ", .{}),
|
||||
|
|
Loading…
Reference in a new issue