From 9e5c7e82de14b6f4284169821f6f6a4dd7091319 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 2 Apr 2021 18:04:03 +0200 Subject: Set CC=cc in config.mk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- config.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.mk b/config.mk index f160bbd..605a704 100644 --- a/config.mk +++ b/config.mk @@ -1,6 +1,8 @@ -PREFIX = /usr +PREFIX = /usr MANPREFIX = $(PREFIX)/share/man +CC = cc + CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 CFLAGS = -std=c11 -Wall -Wextra -O2 $(CPPFLAGS) LDFLAGS = -s -- cgit v1.2.3-70-g09d2 From cd1f1bb076e39a5ddda93e048059c704e5a566dc Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 4 Apr 2021 12:56:27 +0200 Subject: Improve libsimple-arg.h for multicall binaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libsimple-arg.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libsimple-arg.h b/libsimple-arg.h index 983f4c8..67be5e9 100644 --- a/libsimple-arg.h +++ b/libsimple-arg.h @@ -7,6 +7,15 @@ #include +#ifdef LIBSIMPLY_CONFIG_MULTICALL_BINARY /* Define by the application */ +# define _LIBSIMPLY_IF_MULTICALL_BINARY(...) __VA_ARGS__ +# define _LIBSIMPLY_UNLESS_MULTICALL_BINARY(...) +#else +# define _LIBSIMPLY_IF_MULTICALL_BINARY(...) +# define _LIBSIMPLY_UNLESS_MULTICALL_BINARY(...) __VA_ARGS__ +#endif + + /** * The zeroth command line argument, the name of the process, * set by the command line parsing macros @@ -431,7 +440,8 @@ struct longopt { fprintf(stderr, "usage: %s%s%s\n", argv0, *syn ? " " : "", syn);\ exit(STATUS);\ }\ - char *argv0 = NULL + _LIBSIMPLY_UNLESS_MULTICALL_BINARY(char *argv0 = NULL)\ + _LIBSIMPLY_IF_MULTICALL_BINARY(int main(int, char *[])) #endif -- cgit v1.2.3-70-g09d2