From: Bartosz Golaszewski Date: Wed, 27 Sep 2017 09:10:38 +0000 (+0200) Subject: core: new public macro X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2eff5f51e67b98f7abdb03fe469ee4feea338e22;p=qemu-gpiodev%2Flibgpiod.git core: new public macro Export GPIOD_UNUSED in gpiod.h as it may be useful for users not using all arguments in certain callback functions. Signed-off-by: Bartosz Golaszewski --- diff --git a/include/gpiod.h b/include/gpiod.h index 5d52eef..749752a 100644 --- a/include/gpiod.h +++ b/include/gpiod.h @@ -51,6 +51,11 @@ struct gpiod_chip_iter; */ #define GPIOD_BIT(nr) (1UL << (nr)) +/** + * @brief Marks a function argument or variable as potentially unused. + */ +#define GPIOD_UNUSED __attribute__((unused)) + /** * @} * diff --git a/src/lib/simple.c b/src/lib/simple.c index f7041d5..1865646 100644 --- a/src/lib/simple.c +++ b/src/lib/simple.c @@ -16,8 +16,6 @@ #include #include -#define UNUSED __attribute__((unused)) - int gpiod_simple_get_value(const char *consumer, const char *device, unsigned int offset, bool active_low) { @@ -140,7 +138,7 @@ int gpiod_simple_set_value_multiple(const char *consumer, const char *device, static int basic_event_poll(unsigned int num_lines, const int *fds, unsigned int *event_offset, const struct timespec *timeout, - void *data UNUSED) + void *data GPIOD_UNUSED) { struct pollfd poll_fds[GPIOD_REQUEST_MAX_LINES]; unsigned int i;