aboutsummaryrefslogtreecommitdiffstats
path: root/libsimple-arg.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsimple-arg.h')
-rw-r--r--libsimple-arg.h29
1 files changed, 19 insertions, 10 deletions
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