windows: avoid the use of wcwidth

This commit is contained in:
Jeffrey C. Ollie
2026-03-05 09:26:52 -06:00
parent acf54a9166
commit e8aad10326

View File

@@ -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;