fix(libzigc): workaround LLVM bug

* looks like we get stuck inside this loop? 2078da43e2/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp (L245-L298)
This commit is contained in:
GasInfinity 2026-01-16 01:58:35 +01:00
parent e22bf480aa
commit e3309aaf4f
No known key found for this signature in database

View file

@ -107,7 +107,12 @@ fn wcsncmp(a: [*:0]const wchar_t, b: [*:0]const wchar_t, max: usize) callconv(.c
}
fn wcpcpy(noalias dst: [*]wchar_t, noalias src: [*:0]const wchar_t) callconv(.c) [*]wchar_t {
return wcpncpy(dst, src, std.math.maxInt(usize));
const src_slice = std.mem.span(src);
@memcpy(dst[0..src_slice.len], src_slice);
dst[src_slice.len] = 0;
return dst + src_slice.len;
// XXX: LLVM bug?
// return wcpncpy(dst, src, std.math.maxInt(usize));
}
fn wcpncpy(noalias dst: [*]wchar_t, noalias src: [*:0]const wchar_t, max: usize) callconv(.c) [*]wchar_t {