aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-10-23 13:40:54 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-10-23 13:40:54 +0000
commit3155ab45fe392f1dd4984f034d6048f8d79a2228 (patch)
tree05891666a11447c04d733cbc8e9e1adf7db17312
parentterm: bell: simplify if-statement - we don’t need two nested levels (diff)
foot/client: version info: add +/- assertions
-rw-r--r--client.c5
-rw-r--r--foot-features.h9
-rw-r--r--main.c5
3 files changed, 15 insertions, 4 deletions
diff --git a/client.c b/client.c
index 5c767e11..d9566e15 100644
--- a/client.c
+++ b/client.c
@@ -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
diff --git a/main.c b/main.c
index fd27aebd..07f58080 100644
--- a/main.c
+++ b/main.c
@@ -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;
}