From 5717b6dbf1b9272c7bd9bdebe5a4ac267afca687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 19 Oct 2012 17:12:38 -0400 Subject: [PATCH] Stop relying on ARRAY_LENGTH being defined in wayland-util.h Time to break a bad habit. --- clients/simple-touch.c | 2 ++ clients/window.h | 2 ++ src/compositor.h | 1 + 3 files changed, 5 insertions(+) diff --git a/clients/simple-touch.c b/clients/simple-touch.c index 0eeb8f9e..cbe38770 100644 --- a/clients/simple-touch.c +++ b/clients/simple-touch.c @@ -32,6 +32,8 @@ #include #include "../shared/os-compatibility.h" +#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) + struct touch { struct wl_display *display; struct wl_registry *registry; diff --git a/clients/window.h b/clients/window.h index c86d7e78..4dd4c20b 100644 --- a/clients/window.h +++ b/clients/window.h @@ -28,6 +28,8 @@ #include #include "../shared/config-parser.h" +#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) + struct window; struct widget; struct display; diff --git a/src/compositor.h b/src/compositor.h index 4c61db7f..19ab11ea 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -37,6 +37,7 @@ #include "../shared/config-parser.h" #include "weston-egl-ext.h" +#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) struct weston_transform { struct weston_matrix matrix;