Date: Sun, 27 Oct 1996 14:56:49 +0200 (IST) From: Eli Zaretskii To: B Hodge Cc: djgpp AT delorie DOT com Subject: Re: Borland library macro equivalent? In-Reply-To: <54lrf9$ntu@pulp.ucs.ualberta.ca> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 23 Oct 1996, B Hodge wrote: > Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote: > : #define max(a,b) ({ typeof(a) _tmp_a = (a); \ > : typeof(b) _tmp_b = (b); \ > : (_tmp_a > _tmp_b) ? _tmp_a : _tmp_b; }) > > So then the following code would be legal? > > x={ int s, c; s=sin(a); c=cos(a); s*s*y+s*c*y+c*c*y; }; I'm not sure it will work without parentheses around it: x = ({ int s, c; s=sin(a); c=cos(a); s*s*y+s*c*y+c*c*y; }); But this is documented in the GCC docs; just read there. > Is this legal under other languages tooor is it just a DJGPP specific > thing? It's GCC specific, so it will work on any platform if you use GCC.