From owner-freebsd-current@FreeBSD.ORG Wed Aug 11 22:56:02 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E1CA16A4CE for ; Wed, 11 Aug 2004 22:56:02 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E52C43D39 for ; Wed, 11 Aug 2004 22:56:02 +0000 (GMT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 660165C98E; Wed, 11 Aug 2004 15:56:02 -0700 (PDT) Date: Thu, 12 Aug 2004 00:56:02 +0200 From: Maxime Henrion To: Julian Elischer Message-ID: <20040811225602.GN13608@elvis.mu.org> References: <411AA203.1020502@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <411AA203.1020502@elischer.org> User-Agent: Mutt/1.4.2.1i cc: current@freebsd.org Subject: Re: [Fwd: RFC.. defining __rangeof() in cdefs.h] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2004 22:56:02 -0000 Julian Elischer wrote: > Interresting.. not a single comment.. :-/ > > From: Julian Elischer > Date: Mon, 09 Aug 2004 14:40:37 -0700 > To: current@freebsd.org > Subject: RFC.. defining __rangeof() in cdefs.h > > I'm considdereing adding: > Index: sys/cdefs.h > =================================================================== > RCS file: /home/ncvs/src/sys/sys/cdefs.h,v > retrieving revision 1.83 > diff -u -r1.83 cdefs.h > --- sys/cdefs.h 28 Jul 2004 07:03:42 -0000 1.83 > +++ sys/cdefs.h 9 Aug 2004 21:36:41 -0000 > @@ -241,6 +241,8 @@ > * require it. > */ > #define __offsetof(type, field) ((size_t)(&((type *)0)->field)) > +#define __rangeof(type, start, end) \ > + (__offsetof(type, end) - __offsetof(type, start)) > > /* > * Compiler-dependent macros to declare that functions take printf-like > > > it is used in several places. most importantly in fork1() > > and it is defined in several files (*).. we should probably just have > one copy... > > > (*) in the form RANGEOF() but if we define it in cdefs.h I'd change that to > __rangeof() to match __offsetof() The patch looks fine to me, I think it should go in. :-) Cheers, Maxime