motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 6655c6092efbdc8b1aeb89ff9f7a8b05f736916a (tree)
parent 02d69f50092ee9ecfa552ff94d20fde62edd7adc
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Wed, 30 Mar 2022 20:38:01 -0700

std.base64: upgrade to new function pointer semantics

Diffstat:
Mlib/std/base64.zig | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/std/base64.zig b/lib/std/base64.zig @@ -9,11 +9,16 @@ pub const Error = error{ NoSpaceLeft, }; +const decoderWithIgnoreProto = switch (@import("builtin").zig_backend) { + .stage1 => fn (ignore: []const u8) Base64DecoderWithIgnore, + else => *const fn (ignore: []const u8) Base64DecoderWithIgnore, +}; + /// Base64 codecs pub const Codecs = struct { alphabet_chars: [64]u8, pad_char: ?u8, - decoderWithIgnore: fn (ignore: []const u8) Base64DecoderWithIgnore, + decoderWithIgnore: decoderWithIgnoreProto, Encoder: Base64Encoder, Decoder: Base64Decoder, };