aboutsummaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-07-21 17:06:53 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-07-21 17:09:42 +0200
commit0be32393e54bed6bbf5890edba72b8808d276289 (patch)
treeba83502753e64f0c60f5202a8d224b57b52cf14f /types.h
parent85b0db24804e6a8a66f557ac8917596db5fc5d9f (diff)
format
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)