httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: cvs commit: apache-2.0/src/os/win32/installer/installdll/test
Date Fri, 28 Apr 2000 20:12:39 GMT
pg@sweng.stortek.com wrote:
> 
> In a recent note, Jim Jagielski said:
> 
> > Date: Fri, 28 Apr 2000 15:39:31 -0400 (EDT)
> >
> > point was we're saying that if FALSE isn't defined, set it to
> > (0), and maybe that's not quite anal enough :) We _require_ it
> > to be (0), so we almost want:
> >
> >     #undef FALSE
> >     #undef TRUE
> >     #define FALSE (0)
> >     #define TRUE (!FALSE)
> >
> > But this could break stupid setups that use a magic number for TRUE,
> > so that's why I thought APR_TRUE/APR_FALSE might be best.
> >
> The stupid setups are likely to break only on the amateurish
> construct:
> 
>     if ( flag == TRUE ) { ... }

That can arise in non-amateur situations... consider, for example...

	int f1,f2;

	f1=(a == b);
	f2=TRUE;	// obviously this would come from outside in "real life"
	if(f1 == f2)
		dosomething();

also, the one that exposes the incorrectness of the usual scheme:

	struct
		{
		int flag:1;
		} x;

	int flag;

	if(flag == x.flag)
		dosomething();

(exercise for reader: why doesn't this do what you expect?)

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

Mime
View raw message