diff options
| author | 2025-12-02 23:47:10 -0800 | |
|---|---|---|
| committer | 2025-12-04 21:52:04 +0100 | |
| commit | 3ae92228409d82a2c906fafc228b7920d9ff046b (patch) | |
| tree | e3bf40bc3137465a678367ebe7387755c9dbf83a | |
| parent | fix: Use the new @Struct and @Tuple constructors (diff) | |
| download | zig-clap-master.tar.gz zig-clap-master.tar.xz zig-clap-master.zip | |
Without this change, we get the following error when targeting 32bit
platforms (e.g. arm-linux): "@fieldParentPtr increases pointer alignment".
| -rw-r--r-- | clap/codepoint_counting_writer.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clap/codepoint_counting_writer.zig b/clap/codepoint_counting_writer.zig index 3518d48..39d5666 100644 --- a/clap/codepoint_counting_writer.zig +++ b/clap/codepoint_counting_writer.zig | |||
| @@ -17,7 +17,7 @@ pub const CodepointCountingWriter = struct { | |||
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | fn drain(w: *std.Io.Writer, data: []const []const u8, splat: usize) std.Io.Writer.Error!usize { | 19 | fn drain(w: *std.Io.Writer, data: []const []const u8, splat: usize) std.Io.Writer.Error!usize { |
| 20 | const self: *Self = @fieldParentPtr("interface", w); | 20 | const self: *Self = @alignCast(@fieldParentPtr("interface", w)); |
| 21 | var n_bytes_written: usize = 0; | 21 | var n_bytes_written: usize = 0; |
| 22 | var i: usize = 0; | 22 | var i: usize = 0; |
| 23 | 23 | ||