aboutsummaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'types.h')
-rw-r--r--types.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/types.h b/types.h
index 584da21..1c84c74 100644
--- a/types.h
+++ b/types.h
@@ -4,3 +4,7 @@
typedef ptrdiff_t size;
typedef char byte;
typedef uintptr_t uptr;
+
+#define sizeof(x) (size)sizeof(x)
+#define countof(a) (sizeof(a) / sizeof(*(a)))
+#define lengthof(s) (countof(s) - 1)