From f2090b4b13c13711e6e1b9d3a7cde2cf5f121efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 23 Feb 2017 16:52:35 +0100 Subject: vis: make help texts optional to produce a smaller binary $ ./configure --disable-help shrinks the binary by about 20K on a x86_64 system. --- vis.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'vis.h') diff --git a/vis.h b/vis.h index 31d6994..b6fb09e 100644 --- a/vis.h +++ b/vis.h @@ -14,6 +14,20 @@ typedef struct Win Win; #include "text-regex.h" #include "libutf.h" +#ifndef CONFIG_HELP +#define CONFIG_HELP 1 +#endif + +#if CONFIG_HELP +#define VIS_HELP_DECL(x) x +#define VIS_HELP_USE(x) x +#define VIS_HELP(x) (x), +#else +#define VIS_HELP_DECL(x) +#define VIS_HELP_USE(x) NULL +#define VIS_HELP(x) +#endif + /* simplify utility renames by distribution packagers */ #ifndef VIS_MENU #define VIS_MENU "vis-menu" @@ -66,7 +80,7 @@ typedef const char *KeyActionFunction(Vis*, const char *keys, const Arg*); typedef struct { /* a KeyAction can be bound to a key binding */ const char *name; /* aliases can refer to this action by means of a pseudo key */ - const char *help; /* short (one line) human readable description, displayed by :help */ + VIS_HELP_DECL(const char *help;) /* short (one line) human readable description, displayed by :help */ KeyActionFunction *func; /* action implementation */ Arg arg; /* additional arguments which will be passed as to func */ } KeyAction; -- cgit v1.2.3