Instead cluttering the header file, let's add it to meson.build.
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
description: 'Is sys/random.h(getrandom) include-able?'
)
+if cc.has_function_attribute('fallthrough')
+ conf.set('fallthrough', '__attribute__((__fallthrough__))')
+else
+ conf.set('fallthrough', 'do {} while (0) /* fallthrough */')
+endif
+
configure_file(
output: 'config.h',
configuration: conf
#include <string.h>
#include <stdbool.h>
-#if __has_attribute(__fallthrough__)
-#define fallthrough __attribute__((__fallthrough__))
-#else
-#define fallthrough do {} while (0)
-#endif
-
static const char *append_usage_str = "";
static int argconfig_parse_val(struct argconfig_commandline_options *s, struct option *option,