windows: avoid the use of wcwidth
parent
acf54a9166
commit
e8aad10326
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue