Re: [gtk-list] Re: Minor patch to glib.h in 1.0.2...



Tim Janik wrote:
> ...
> >       avoid conditionals. unconditionally define NULL, TRUE, FALSE, MAX,
> >       MIN, ABS and CLAMP, these macros might be screwed from other headers.
> >
> > This shouldn't be necessary for NULL, since that is defined by ANSI C.
> ...
> yep, that was how it previously worked, i guess i'll have to make
> sure to not use screwed include files then ;(
> although it wasn't NULL that was screwed but some of the max/min/clamp
> things.

The patch I provided just adds the conditional stuff for NULL, TRUE,
and FALSE.  It also changes the definition of TRUE from 1 to !0 in
the (unlikely) event that a compiler defines !0 to be -1 (I've only
seen this a couple times in days past).

The MIN, MAX, and CLAMP macros are AFAIK not standard defines anyways.

-- 
________________________________________________________________________
 Mike Sweet         Software for HP, SGI,        Easy Software Products
 (301) 373-9603     and Sun Workstations       44145 Airport View Drive
 mike@easysw.com    http://www.easysw.com    Hollywood, Maryland  20636



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]