mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
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.
This commit is contained in:
parent
fa3c17abb9
commit
5a1df02f01
@ -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…
x
Reference in New Issue
Block a user