From 3077b37101c0c7b89368eafb043adc95eb8db45c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 19 Dec 2016 11:33:40 +0100 Subject: [PATCH] include/c.h: add errtryhelp() Add code to print: Try ' --help' for more information. and exit. Signed-off-by: Karel Zak --- include/c.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/c.h b/include/c.h index 08dab934a0..bf11d61acb 100644 --- a/include/c.h +++ b/include/c.h @@ -204,6 +204,15 @@ errmsg(char doexit, int excode, char adderr, const char *fmt, ...) #endif /* !HAVE_ERR_H */ +/* Don't use inline function to avoid '#include "nls.h"' in c.h + */ +#define errtryhelp(eval) __extension__ ({ \ + fprintf(stderr, _("Try '%s --help' for more information.\n"), \ + program_invocation_short_name); \ + exit(eval); \ +}) + + static inline __attribute__((const)) int is_power_of_2(unsigned long num) { return (num != 0 && ((num & (num - 1)) == 0)); -- 2.47.3