features: add +/-system-bell to version output

This commit is contained in:
Daniel Eklöf 2025-01-17 11:22:23 +01:00
parent 2a07a2e6b9
commit aeb28e33fa
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 15 additions and 3 deletions

View file

@ -67,12 +67,14 @@ version_and_features(void)
{ {
static char buf[256]; static char buf[256];
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"version: %s %cpgo %cime %cgraphemes %cassertions", "version: %s %cpgo %cime %cgraphemes %ctoplevel-icon %csystem-bell %cassertions",
FOOT_VERSION, FOOT_VERSION,
feature_pgo() ? '+' : '-', feature_pgo() ? '+' : '-',
feature_ime() ? '+' : '-', feature_ime() ? '+' : '-',
feature_graphemes() ? '+' : '-', feature_graphemes() ? '+' : '-',
feature_assertions() ? '+' : '-'); feature_xdg_toplevel_icon() ? '+' : '-',
feature_xdg_system_bell() ? '+' : '-',
feature_assertions() ? '+' : '-');
return buf; return buf;
} }

View file

@ -46,3 +46,12 @@ static inline bool feature_xdg_toplevel_icon(void)
return false; return false;
#endif #endif
} }
static inline bool feature_xdg_system_bell(void)
{
#if defined(HAVE_XDG_SYSTEM_BELL)
return true;
#else
return false;
#endif
}

3
main.c
View file

@ -51,12 +51,13 @@ version_and_features(void)
{ {
static char buf[256]; static char buf[256];
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"version: %s %cpgo %cime %cgraphemes %ctoplevel-icon %cassertions", "version: %s %cpgo %cime %cgraphemes %ctoplevel-icon %csystem-bell %cassertions",
FOOT_VERSION, FOOT_VERSION,
feature_pgo() ? '+' : '-', feature_pgo() ? '+' : '-',
feature_ime() ? '+' : '-', feature_ime() ? '+' : '-',
feature_graphemes() ? '+' : '-', feature_graphemes() ? '+' : '-',
feature_xdg_toplevel_icon() ? '+' : '-', feature_xdg_toplevel_icon() ? '+' : '-',
feature_xdg_system_bell() ? '+' : '-',
feature_assertions() ? '+' : '-'); feature_assertions() ? '+' : '-');
return buf; return buf;
} }