simd: add scalar fallbacks to all for build_options.simd false

This commit is contained in:
Mitchell Hashimoto
2025-09-22 08:02:55 -07:00
parent 8aa4373aaf
commit 6893024c51
7 changed files with 117 additions and 22 deletions

View File

@@ -1,11 +1,12 @@
const std = @import("std");
const options = @import("build_options");
// vt.cpp
extern "c" fn ghostty_simd_codepoint_width(u32) i8;
pub fn codepointWidth(cp: u32) i8 {
//return @import("ziglyph").display_width.codePointWidth(@intCast(cp), .half);
return ghostty_simd_codepoint_width(cp);
if (comptime options.simd) return ghostty_simd_codepoint_width(cp);
return @import("ziglyph").display_width.codePointWidth(@intCast(cp), .half);
}
test "codepointWidth basic" {