From 9c8ab5d64cb1bfc6f8a235af5913ed3537c38e2a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 31 Dec 2012 15:02:31 +0100 Subject: [PATCH] utils: move ARRAY_SIZE from uloop to utils.h Signed-off-by: Felix Fietkau --- uloop.c | 5 +---- utils.h | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/uloop.c b/uloop.c index a28bce8..88e9c81 100644 --- a/uloop.c +++ b/uloop.c @@ -32,6 +32,7 @@ #include #include "uloop.h" +#include "utils.h" #ifdef USE_KQUEUE #include @@ -41,10 +42,6 @@ #endif #include - -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) -#endif #define ULOOP_MAX_EVENTS 10 static struct list_head timeouts = LIST_HEAD_INIT(timeouts); diff --git a/utils.h b/utils.h index e56998d..065a28b 100644 --- a/utils.h +++ b/utils.h @@ -34,4 +34,8 @@ void *__calloc_a(size_t len, ...); +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +#endif + #endif -- 2.25.1