From 49731fd385ed1960a229c64a02a3b542870fcd38 Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Wed, 4 Feb 2009 18:31:03 -0800 Subject: [PATCH] fix OFFSET_OF on 64-bit architectures --- ucw/lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucw/lib.h b/ucw/lib.h index e56cfad1..cae773d9 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) ((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)) -- 2.39.2