diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-10-23 13:40:54 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-10-23 13:40:54 +0000 |
| commit | 3155ab45fe392f1dd4984f034d6048f8d79a2228 (patch) | |
| tree | 05891666a11447c04d733cbc8e9e1adf7db17312 | |
| parent | term: bell: simplify if-statement - we don’t need two nested levels (diff) | |
foot/client: version info: add +/- assertions
| -rw-r--r-- | client.c | 5 | ||||
| -rw-r--r-- | foot-features.h | 9 | ||||
| -rw-r--r-- | main.c | 5 |
3 files changed, 15 insertions, 4 deletions
@@ -43,11 +43,12 @@ static const char * version_and_features(void) { static char buf[256]; - snprintf(buf, sizeof(buf), "version: %s %cpgo %cime %cgraphemes", + snprintf(buf, sizeof(buf), "version: %s %cpgo %cime %cgraphemes %cassertions", FOOT_VERSION, feature_pgo() ? '+' : '-', feature_ime() ? '+' : '-', - feature_graphemes() ? '+' : '-'); + feature_graphemes() ? '+' : '-', + feature_assertions() ? '+' : '-'); return buf; } diff --git a/foot-features.h b/foot-features.h index cdc8056f..ad447767 100644 --- a/foot-features.h +++ b/foot-features.h @@ -2,6 +2,15 @@ #include <stdbool.h> +static inline bool feature_assertions(void) +{ +#if defined(NDEBUG) + return false; +#else + return true; +#endif +} + static inline bool feature_ime(void) { #if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED @@ -45,11 +45,12 @@ static const char * version_and_features(void) { static char buf[256]; - snprintf(buf, sizeof(buf), "version: %s %cpgo %cime %cgraphemes", + snprintf(buf, sizeof(buf), "version: %s %cpgo %cime %cgraphemes %cassertions", FOOT_VERSION, feature_pgo() ? '+' : '-', feature_ime() ? '+' : '-', - feature_graphemes() ? '+' : '-'); + feature_graphemes() ? '+' : '-', + feature_assertions() ? '+' : '-'); return buf; } |
