From 01969818aec859611ca1989783b6e0d7f81bdf9e Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 19 Aug 2022 06:50:12 +0200 Subject: alignof, offsetof --- src/common.hff | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/common.hff') 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 -- cgit v1.2.3