diff options
author | Ian Moffett <ian@osmora.org> | 2024-12-15 21:47:42 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-12-15 21:47:42 -0500 |
commit | 943e80365394df36a41fa19b6e3227f11f044cb6 (patch) | |
tree | bc8c7850a7c3db363c8d8343ae17b30b2e486216 | |
parent | 1304cef32d112acf72b37b61910c9fa623f4af08 (diff) |
kernel: Add offsetof in cdefs.h
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | sys/include/sys/cdefs.h | 4 |
1 files changed, 4 insertions, 0 deletions
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 |