Use runtime wcwidth() to check libc

We've been using #ifdefs and such to check for libc
Unicode 13 support at compile time. Instead, execute
a wcwidth() using a sextant. If it comes back -1, the
libc lacks support; disable sextants. Otherwise, let
it go. This ought allow us to support sextants on BSD
as soon as it has support; it furthermore allows us to
properly disable them on Linuxes lacking such support.
Closes #1289.
pull/1293/head
nick black 4 years ago
parent fa3c17abb9
commit 5a1df02f01
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -59,10 +59,10 @@ apply_term_heuristics(tinfo* ti, const char* termname){
}else if(strstr(termname, "vte") || strstr(termname, "gnome")){
ti->sextants = true; // VTE has long enjoyed good sextant support
}
// as of freebsd 12.1 / dragonfly 5.9, there's no libc support for sextants
#if defined(__FreeBSD__) || defined(__DragonFly__)
ti->sextants = false;
#endif
// run a wcwidth() to guarantee libc Unicode 13 support
if(wcwidth(L'🬸') < 0){
ti->sextants = false;
}
return 0;
}

Loading…
Cancel
Save