Subject: Re: CVS commit: src/usr.sbin/installboot
To: Christos Zoulas <christos@astron.com>
From: David Laight <david@l8s.co.uk>
List: source-changes
Date: 10/30/2006 21:20:22
On Mon, Oct 30, 2006 at 03:59:21PM +0000, Christos Zoulas wrote:
> >
> >I've also deliberatly used:
> >
> >#define x(y) if (y); else {...}
> >
> >To avoid having to wrap the expansion inside do ... while (0);
>
> How is one supposed to use this macro?
I remember now, it would be for single statement conditionals. eg:
#define return_nz(r) if (!r); else return (r)
Which is quite happy as:
return_nz(a);
if (b)
return_nz(a);
if (c)
...
else
return_nz(a);
David
--
David Laight: david@l8s.co.uk