mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-18 05:34:02 -04:00
main/client: simplify code for printing --version string
This commit is contained in:
parent
d48a1c53f5
commit
eb9357709b
5 changed files with 42 additions and 68 deletions
|
|
@ -1,39 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static inline bool feature_assertions(void)
|
||||
{
|
||||
#if defined(NDEBUG)
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
extern const char version_and_features[];
|
||||
|
||||
static inline bool feature_ime(void)
|
||||
static inline void
|
||||
print_version_and_features(const char *prefix)
|
||||
{
|
||||
#if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool feature_pgo(void)
|
||||
{
|
||||
#if defined(FOOT_PGO_ENABLED) && FOOT_PGO_ENABLED
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool feature_graphemes(void)
|
||||
{
|
||||
#if defined(FOOT_GRAPHEME_CLUSTERING) && FOOT_GRAPHEME_CLUSTERING
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
fputs(prefix, stdout);
|
||||
fputs(version_and_features, stdout);
|
||||
fputc('\n', stdout);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue