From 68f19d7335676e76404528033463675a7995e6c4 Mon Sep 17 00:00:00 2001 From: eck Date: Mon, 29 Oct 1990 13:52:18 +0000 Subject: [PATCH] changed offsetof(), so it will not generate a warning on 2-4 machines --- lang/cem/libcc.ansi/headers/stddef.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lang/cem/libcc.ansi/headers/stddef.h b/lang/cem/libcc.ansi/headers/stddef.h index aa4c370f5..aa60ff63d 100644 --- a/lang/cem/libcc.ansi/headers/stddef.h +++ b/lang/cem/libcc.ansi/headers/stddef.h @@ -11,7 +11,8 @@ #define NULL ((void *)0) -#define offsetof(type, ident) ((size_t) &(((type *)0)->ident)) +#define offsetof(type, ident) ((size_t) (unsigned long) (char *)(&((type *)0)->ident)) + #if _EM_PSIZE == _EM_WSIZE typedef int ptrdiff_t; /* result of substracting two pointers */ -- 2.34.1