utils: move ARRAY_SIZE from uloop to utils.h
authorFelix Fietkau <nbd@openwrt.org>
Mon, 31 Dec 2012 14:02:31 +0000 (15:02 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 31 Dec 2012 14:24:27 +0000 (15:24 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uloop.c
utils.h

diff --git a/uloop.c b/uloop.c
index a28bce8af72af06ce95e509c4df8ed212d76c451..88e9c814fce0d329a0a6afbef72edeae9e3b2f74 100644 (file)
--- a/uloop.c
+++ b/uloop.c
@@ -32,6 +32,7 @@
 #include <stdbool.h>
 
 #include "uloop.h"
+#include "utils.h"
 
 #ifdef USE_KQUEUE
 #include <sys/event.h>
 #endif
 #include <sys/wait.h>
 
-
-#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 e56998d2f3bbad6198eed676be8fd252b8311e2c..065a28b343f9e29e7cb4fe53d49313ff539fb972 100644 (file)
--- 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