diff options
| author | 2022-08-19 06:50:12 +0200 | |
|---|---|---|
| committer | 2022-08-19 06:50:12 +0200 | |
| commit | 01969818aec859611ca1989783b6e0d7f81bdf9e (patch) | |
| tree | 80324a21b5b4647107d6596eaabd741e9f824f39 /src/common.hff | |
| parent | eb48600f4da4e52dd2cb46a284474c4cba8fe237 (diff) | |
alignof, offsetof
Diffstat (limited to 'src/common.hff')
| -rw-r--r-- | src/common.hff | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/common.hff b/src/common.hff index 6643dda..187fbf3 100644 --- a/src/common.hff +++ b/src/common.hff @@ -52,11 +52,8 @@ defmacro with_tmpchange(var,x,&body) [ defmacro MAX(a,b) [((a) > (b) ? (a) : (b))] -defmacro offsetof_(T, fld) [ - (as(isize)(&(as(*T)#null).fld)) -] defmacro container_of(x, T, fld) [ - (as(*T)(as(*void)(x) - offsetof_(T, fld))) + (as(*T)(as(*void)(x) - offsetof(T, fld))) ] // Inline functions |