main: include +/-wcwidth in version output

* +wcwidth: use our own, builtin, wcwidth()
* -wcwidth: use system’s wcwidth()
This commit is contained in:
Daniel Eklöf 2022-01-05 22:15:39 +01:00
parent 97ade97d38
commit 402972085a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 12 additions and 2 deletions

View file

@ -37,3 +37,12 @@ static inline bool feature_graphemes(void)
return false; return false;
#endif #endif
} }
static inline bool feature_builtin_wcwidth(void)
{
#if FOOT_SYSTEM_WCWIDTH == 0
return true;
#else
return false;
#endif
}

5
main.c
View file

@ -45,12 +45,13 @@ static const char *
version_and_features(void) version_and_features(void)
{ {
static char buf[256]; static char buf[256];
snprintf(buf, sizeof(buf), "version: %s %cpgo %cime %cgraphemes %cassertions", snprintf(buf, sizeof(buf), "version: %s %cpgo %cime %cgraphemes %cassertions %cwcwidth",
FOOT_VERSION, FOOT_VERSION,
feature_pgo() ? '+' : '-', feature_pgo() ? '+' : '-',
feature_ime() ? '+' : '-', feature_ime() ? '+' : '-',
feature_graphemes() ? '+' : '-', feature_graphemes() ? '+' : '-',
feature_assertions() ? '+' : '-'); feature_assertions() ? '+' : '-',
feature_builtin_wcwidth() ? '+' : '-');
return buf; return buf;
} }