X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Flib.h;h=99b848e348c4d1cd0ce3aa1cab85d2f20d3bf9ee;hb=bcd1c2df2198ba426455e7fdeba7dea0e0c8e0cf;hp=e56cfad1e041a30af3b34ef9cecc7669cb3e3f9a;hpb=33ee0ee20ddac8ea99f501dcedc260fa9e0b2d3d;p=libucw.git diff --git a/ucw/lib.h b/ucw/lib.h index e56cfad1..99b848e3 100644 --- a/ucw/lib.h +++ b/ucw/lib.h @@ -20,7 +20,7 @@ #define CHECK_PTR_TYPE(x, type) ((x)-(type)(x) + (type)(x)) #define PTR_TO(s, i) &((s*)0)->i -#define OFFSETOF(s, i) ((unsigned int) PTR_TO(s, i)) +#define OFFSETOF(s, i) ((unsigned int) (uintptr_t) PTR_TO(s, i)) #define SKIP_BACK(s, i, p) ((s *)((char *)p - OFFSETOF(s, i))) #define ALIGN_TO(s, a) (((s)+a-1)&~(a-1)) #define ALIGN_PTR(p, s) ((uintptr_t)(p) % (s) ? (typeof(p))((uintptr_t)(p) + (s) - (uintptr_t)(p) % (s)) : (p))