From 943e80365394df36a41fa19b6e3227f11f044cb6 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 15 Dec 2024 21:47:42 -0500 Subject: kernel: Add offsetof in cdefs.h Signed-off-by: Ian Moffett --- sys/include/sys/cdefs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/include/sys/cdefs.h b/sys/include/sys/cdefs.h index e5d5531..92cdec3 100644 --- a/sys/include/sys/cdefs.h +++ b/sys/include/sys/cdefs.h @@ -48,6 +48,10 @@ #define __END_DECLS #endif +#ifndef offsetof +#define offsetof(st, m) ((size_t)&(((st *)0)->m)) +#endif /* offsetof */ + #if defined(_KERNEL) /* * Align data on a cache line boundary. This is -- cgit v1.2.3