From 35d8fa6f103a93dad0de6b7adb5181d6882db3f9 Mon Sep 17 00:00:00 2001 From: Aetias Date: Sat, 8 Mar 2025 11:46:11 +0100 Subject: [PATCH] Add `offsetof` macro --- libs/c/include/stddef.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/c/include/stddef.h b/libs/c/include/stddef.h index 4986043a..b0c76af3 100644 --- a/libs/c/include/stddef.h +++ b/libs/c/include/stddef.h @@ -5,4 +5,6 @@ typedef unsigned int size_t; +#define offsetof(type, member) (size_t) &((type *) NULL)->member + #endif