include/c: add print_version_with_features()

Signed-off-by: Karel Zak <kzak@redhat.com>
pull/1718/head
Karel Zak 4 months ago
parent 3b0ed60251
commit beafda1869
  1. 21
      include/c.h

@ -438,6 +438,27 @@ static inline int xusleep(useconds_t usec)
exit(eval); \
})
static inline void print_features(const char **features)
{
if (features && *features) {
const char **p = features;
while (p && *p) {
fputs(p == features ? " (" : ", ", stdout);
fputs(*p++, stdout);
}
fputc(')', stdout);
}
}
#define UTIL_LINUX_VERSION_NOBREAK _("%s from %s"), program_invocation_short_name, PACKAGE_STRING
#define print_version_with_features(eval, features) __extension__ ({ \
printf(UTIL_LINUX_VERSION_NOBREAK); \
print_features(features); \
fputc('\n', stdout); \
exit(eval); \
})
/*
* seek stuff
*/

Loading…
Cancel
Save