summaryrefslogtreecommitdiffstats
path: root/src/macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/macros.h b/src/macros.h
index c11ee660c9..4ca24c0f5d 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -396,3 +396,6 @@
#ifndef MAX
# define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
+
+// Length of the array.
+#define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0]))