summaryrefslogtreecommitdiff
path: root/include/fitz/base.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/fitz/base.h')
-rw-r--r--include/fitz/base.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/fitz/base.h b/include/fitz/base.h
index 562bb1df..d6b35592 100644
--- a/include/fitz/base.h
+++ b/include/fitz/base.h
@@ -4,6 +4,9 @@
#undef offsetof
#define offsetof(s, m) (unsigned long)(&(((s*)0)->m))
+#undef nelem
+#define nelem(x) (sizeof(x)/sizeof((x)[0]))
+
#undef ABS
#define ABS(x) ( (x) < 0 ? -(x) : (x) )