From owner-freebsd-current@FreeBSD.ORG Thu Aug 12 15:21:11 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 8217B16A4CE for ; Thu, 12 Aug 2004 15:21:11 +0000 (GMT) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CC9F43D31 for ; Thu, 12 Aug 2004 15:21:11 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.13.0/8.13.0) with ESMTP id i7CFL6SD016550; Thu, 12 Aug 2004 11:21:07 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <411AA203.1020502@elischer.org> References: <411AA203.1020502@elischer.org> Date: Thu, 12 Aug 2004 11:21:05 -0400 To: Julian Elischer , current@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) 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: Thu, 12 Aug 2004 15:21:11 -0000 At 3:47 PM -0700 8/11/04, Julian Elischer wrote: >Interresting.. not a single comment.. :-/ > >I'm considering 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... I was going to look to see what this did and how it was used, but if it is already defined in several files than I figured there probably wasn't anything seriously wrong with it. I will admit that the term "rangeof" brings a different function to my mind, but I have a feeling everyone's nerves are on edge (with the code-freeze coming up), so I didn't want to make too much of a big deal about it. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu