aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-01-16 14:31:44 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-01-16 14:31:44 +0200
commit19389f2b82ec54fd4c847a18f16482e7be4c9887 (patch)
treed97abb593a7e858755dc72d4107f7e217fbd2e49
parentMake Uncompresed Size validation more strict (diff)
downloadxz-19389f2b82ec54fd4c847a18f16482e7be4c9887.tar.xz
Added ARRAY_SIZE(array) macro.
-rw-r--r--src/common/sysdefs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/sysdefs.h b/src/common/sysdefs.h
index 7b69504c..8ebe476f 100644
--- a/src/common/sysdefs.h
+++ b/src/common/sysdefs.h
@@ -154,4 +154,8 @@ typedef unsigned char _Bool;
# define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif
+#ifndef ARRAY_SIZE
+# define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
+#endif
+
#endif