summaryrefslogtreecommitdiff
path: root/include/dix.h
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-07-10 02:02:50 +0100
committerKeith Packard <keithp@keithp.com>2012-07-09 23:06:41 -0700
commit854c1fa4a1e90288d1e2f3777fac3e1a9acb1235 (patch)
tree34d17367c91f9145ceccb90beaccddad68be7d05 /include/dix.h
parent67953d6975ef2ee573b95e7641aaf3d72e9f8379 (diff)
Add a common ARRAY_SIZE macro to dix.h
Does what it says on the box, replacing those from Xi/ and glx/. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'include/dix.h')
-rw-r--r--include/dix.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/dix.h b/include/dix.h
index 5bc1daa87..74123b51b 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -64,6 +64,8 @@ SOFTWARE.
#define REQUEST(type) \
type *stuff = (type *)client->requestBuffer
+#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
+
#define REQUEST_SIZE_MATCH(req)\
if ((sizeof(req) >> 2) != client->req_len)\
return(BadLength)