This macro is only used by gpioinfo and is not relevant for the GPIO
API. Remove it from gpiod.h and define it directly in gpioinfo.c.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
#define GPIOD_API __attribute__((visibility("default")))
-#define GPIOD_ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
-
#define GPIOD_BIT(nr) (1UL << (nr))
int gpiod_errno(void) GPIOD_API;
/* REVISIT This program needs a nicer, better formatted output. */
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
+
struct flag {
const char *name;
bool (*is_set)(struct gpiod_line *);
: "active-high");
flag_printed = false;
- for (j = 0; j < GPIOD_ARRAY_SIZE(flags); j++) {
+ for (j = 0; j < ARRAY_SIZE(flags); j++) {
if (flags[j].is_set(line)) {
if (flag_printed)
printf(" ");