delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/24/07:21:34

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Borland library macro equivalent?
Date: Wed, 23 Oct 1996 20:22:47 -0700
Organization: Three pounds of chaos and a pinch of salt
Lines: 26
Message-ID: <326EE107.1659@cs.com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 961023132054 DOT 7645C-100000 AT is>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp110.cs.com
Mime-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eli Zaretskii wrote:
> 
> Ha!  That's GCC we are using, remember?  We don't need to suffer from no
> steenking double-evaluating compilers anymore:
> 
>         #define max(a,b) ({ typeof(a) _tmp_a = (a); \
>                             typeof(b) _tmp_b = (b); \
>                             (_tmp_a > _tmp_b) ? _tmp_a : _tmp_b; })

Is that C or C++ you're talking about?  I thought only C++ let you
declare variables anywhere other than at the beginning of a block.  Or
is this a special extension to the macro facility?

Hmm, I guess I'd better go look through the docs some more.  ;)

-- 
John M. Aldrich <fighteer AT cs DOT com>                      

* Anything that happens, happens.
* Anything that, in happening, causes something else to happen,
  causes something else to happen.
* Anything that, in happening, causes itself to happen again, happens
  again.
* It doesn't necessarily do it in chronological order, though.
 
                                       --- Douglas Adams

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019