From 54ca48450cf20c453a092aa95d086cd5c5751fcf Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 27 Oct 2000 11:45:49 +0000 Subject: Convert all users of fldoff() to offsetof(). fldoff() is bad because it only takes a struct tag which makes it impossible to use unions, typedefs etc. Define __offsetof() in Define offsetof() in terms of __offsetof() in and Remove myriad of local offsetof() definitions. Remove includes of in kernel code. NB: Kernelcode should *never* include from /usr/include ! Make include to avoid polluting the API. Deprecate with a warning. The warning turns into an error on 01-12-2000 and the file gets removed entirely on 01-01-2001. Paritials reviews by: various. Significant brucifications by: bde --- include/stddef.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/stddef.h') diff --git a/include/stddef.h b/include/stddef.h index 38a7736..feeebc9 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)stddef.h 8.1 (Berkeley) 6/2/93 + * + * $FreeBSD$ */ #ifndef _STDDEF_H_ @@ -61,6 +63,6 @@ typedef _BSD_WCHAR_T_ wchar_t; #define NULL 0 #endif -#define offsetof(type, member) ((size_t)(&((type *)0)->member)) +#define offsetof(type, member) __offsetof(type, member) #endif /* _STDDEF_H_ */ -- cgit v1.1