summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2025-06-17 14:07:31 +0200
committerChris Boesch <chrboesch@noreply.codeberg.org>2025-06-17 14:07:31 +0200
commit451e1a373969f81fb63223e10b1d69ba7dac3523 (patch)
treea4873adda2b06d41685e35c2aa8e647655bfc900
parent54b2b58b6a25bb3efe42014aa78b70282d84793d (diff)
Fixes the changes in zig's struct.fields
-rw-r--r--exercises/065_builtins2.zig8
-rw-r--r--patches/patches/065_builtins2.patch6
2 files changed, 9 insertions, 5 deletions
diff --git a/exercises/065_builtins2.zig b/exercises/065_builtins2.zig
index 6b8168c..067f07c 100644
--- a/exercises/065_builtins2.zig
+++ b/exercises/065_builtins2.zig
@@ -99,11 +99,15 @@ pub fn main() void {
// 'fields' is a slice of StructFields. Here's the declaration:
//
// pub const StructField = struct {
- // name: []const u8,
+ // name: [:0]const u8,
// type: type,
- // default_value: anytype,
+ // default_value_ptr: ?*const anyopaque,
// is_comptime: bool,
// alignment: comptime_int,
+ //
+ // defaultValue() ?sf.type // Function that loads the
+ // // field's default value from
+ // // `default_value_ptr`
// };
//
// Please complete these 'if' statements so that the field
diff --git a/patches/patches/065_builtins2.patch b/patches/patches/065_builtins2.patch
index e5e6410..ad4192b 100644
--- a/patches/patches/065_builtins2.patch
+++ b/patches/patches/065_builtins2.patch
@@ -1,5 +1,5 @@
---- exercises/065_builtins2.zig 2024-11-02 16:58:30.607829441 +0100
-+++ answers/065_builtins2.zig 2024-11-02 16:58:33.821220588 +0100
+--- exercises/065_builtins2.zig 2025-06-17 13:58:07.857258167 +0200
++++ answers/065_builtins2.zig 2025-06-17 13:56:36.630415938 +0200
@@ -58,7 +58,7 @@
// Oops! We cannot leave the 'me' and 'myself' fields
// undefined. Please set them here:
@@ -18,7 +18,7 @@
// Now we print a pithy statement about Narcissus.
print("A {s} loves all {s}es. ", .{
-@@ -109,15 +109,15 @@
+@@ -113,15 +113,15 @@
// Please complete these 'if' statements so that the field
// name will not be printed if the field is of type 'void'
// (which is a zero-bit type that takes up no space at all!):