summaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2019-01-06 09:47:02 -0500
committerRob Clark <robdclark@gmail.com>2019-01-10 10:52:51 -0500
commitd8da3dcfdfe33ee525cf562e928a5266ac69843c (patch)
tree1dc1e9de501eb85824e74c6c41943cf9a472cb0b /common.h
parent485b385e966a63cecc143765d112d267b299ffe5 (diff)
downloadkmscube-d8da3dcfdfe33ee525cf562e928a5266ac69843c.tar.gz
De-duplicate ARRAY_SIZE macro
Diffstat (limited to 'common.h')
-rw-r--r--common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/common.h b/common.h
index cff2c33..17c4073 100644
--- a/common.h
+++ b/common.h
@@ -33,6 +33,8 @@
#include <drm_fourcc.h>
#include <stdbool.h>
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
#ifndef DRM_FORMAT_MOD_LINEAR
#define DRM_FORMAT_MOD_LINEAR 0
#endif