CeDOS - Commit 7c11b2e4

common: Add containerof macro Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
Celina Sophie Kalus
Sun, 10 Aug 2025 20:50:43 +0200
1 files changed, 8 insertions(+), 0 deletions(-)

jump to
A common/utils.h

@@ -0,0 +1,8 @@

+#ifndef INCLUDE_UTILS_H +#define INCLUDE_UTILS_H + +#include <stddef.h> + +#define containerof(ptr, type, member) ((void*)(ptr) - offsetof(type, member)) + +#endif