[Fwd: RFC.. defining __rangeof() in cdefs.h]

Garance A Drosihn drosih at rpi.edu
Thu Aug 12 08:21:11 PDT 2004


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 at gilead.netel.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu


More information about the freebsd-current mailing list