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>
This commit is contained in:
Daniel Stone 2012-07-10 02:02:50 +01:00 • committed by Keith Packard
commit 854c1fa4a1
3 changed files with 2 additions and 4 deletions

View file

@ -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)