aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/stddef.h
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-07 19:02:38 +0900
committernsfisis <nsfisis@gmail.com>2026-02-07 19:02:52 +0900
commit7ba8a506a215846d14d71487807f5e525e9e5c16 (patch)
tree5bdd89ecabdf1b9c89d469f13ab1699566e5284f /include/stddef.h
parent55d624106b3abedfa13d8ea7c2edeef0d0da77a2 (diff)
downloadducc-7ba8a506a215846d14d71487807f5e525e9e5c16.tar.gz
ducc-7ba8a506a215846d14d71487807f5e525e9e5c16.tar.zst
ducc-7ba8a506a215846d14d71487807f5e525e9e5c16.zip
feat: allow calling offsetof() in compile-time expression
Diffstat (limited to 'include/stddef.h')
-rw-r--r--include/stddef.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stddef.h b/include/stddef.h
index ffcf225..2689311 100644
--- a/include/stddef.h
+++ b/include/stddef.h
@@ -7,7 +7,7 @@ typedef unsigned long size_t;
typedef int wchar_t;
typedef long ptrdiff_t;
-#define offsetof(T, m) (ptrdiff_t)((void*)((T*)0)->m)
+#define offsetof(T, m) ((ptrdiff_t)(void*)(&((T*)0)->m))
// TODO:
// - max_align_t (C11)