From 9b483673c0c8a52d81127a23788fa4c976f2b10f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 12 Jun 2022 18:48:26 +0200 Subject: Replace to last static inline's with line + extern inline, and fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libsimple-arg.h | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'libsimple-arg.h') diff --git a/libsimple-arg.h b/libsimple-arg.h index 1d52b33..6aa3c2a 100644 --- a/libsimple-arg.h +++ b/libsimple-arg.h @@ -8,11 +8,11 @@ #ifdef LIBSIMPLY_CONFIG_MULTICALL_BINARY /* Define by the application */ -# define _LIBSIMPLY_IF_MULTICALL_BINARY(...) __VA_ARGS__ -# define _LIBSIMPLY_UNLESS_MULTICALL_BINARY(...) +# 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__ +# define LIBSIMPLY_IF_MULTICALL_BINARY__(...) +# define LIBSIMPLY_UNLESS_MULTICALL_BINARY__(...) __VA_ARGS__ #endif @@ -48,10 +48,19 @@ struct longopt { */ char short_flag; +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +#endif + /** * Whether the option takes an argument */ int with_arg; + +#if defined(__clang__) +# pragma clang diagnostic pop +#endif }; @@ -410,11 +419,11 @@ struct longopt { /* Intended for internal use only */ #if __STDC_VERSION__ >= 201112L -# define _LIBSIMPLE_NORETURN _Noreturn +# define LIBSIMPLE_NORETURN__ _Noreturn #elif defined(__GNUC__) || defined(__clang__) -# define _LIBSIMPLE_NORETURN __attribute__((noreturn)) +# define LIBSIMPLE_NORETURN__ __attribute__((noreturn)) #else -# define _LIBSIMPLE_NORETURN +# define LIBSIMPLE_NORETURN__ #endif @@ -433,15 +442,15 @@ struct longopt { * @parma STATUS:int The exit value for the process */ #define NUSAGE(STATUS, SYNOPSIS)\ - static _LIBSIMPLE_NORETURN void\ + static LIBSIMPLE_NORETURN__ void\ usage(void)\ {\ const char *syn = (const char *)SYNOPSIS ? SYNOPSIS : "";\ fprintf(stderr, "usage: %s%s%s\n", argv0, *syn ? " " : "", syn);\ exit(STATUS);\ }\ - _LIBSIMPLY_UNLESS_MULTICALL_BINARY(char *argv0 = NULL)\ - _LIBSIMPLY_IF_MULTICALL_BINARY(int main(int, char *[])) + LIBSIMPLY_UNLESS_MULTICALL_BINARY__(char *argv0 = NULL)\ + LIBSIMPLY_IF_MULTICALL_BINARY__(int main(int, char *[])) #endif -- cgit v1.2.3-70-g09d2