From e8aad103263297d41335a27d9d1679a7ab47c08b Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Thu, 5 Mar 2026 09:26:52 -0600 Subject: [PATCH] windows: avoid the use of wcwidth --- src/benchmark/CodepointWidth.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/benchmark/CodepointWidth.zig b/src/benchmark/CodepointWidth.zig index effabb036..30d3f91e7 100644 --- a/src/benchmark/CodepointWidth.zig +++ b/src/benchmark/CodepointWidth.zig @@ -6,6 +6,7 @@ const CodepointWidth = @This(); const std = @import("std"); +const builtin = @import("builtin"); const assert = std.debug.assert; const Allocator = std.mem.Allocator; const Benchmark = @import("Benchmark.zig"); @@ -104,6 +105,11 @@ fn stepNoop(ptr: *anyopaque) Benchmark.Error!void { extern "c" fn wcwidth(c: u32) c_int; fn stepWcwidth(ptr: *anyopaque) Benchmark.Error!void { + if (comptime builtin.os.tag == .windows) { + log.warn("wcwidth is not available on Windows", .{}); + return; + } + const self: *CodepointWidth = @ptrCast(@alignCast(ptr)); const f = self.data_f orelse return;