Re: small patch for pty.c

From: Peter Steiner (p.steiner@t-online.de)
Date: Mon Apr 17 2000 - 10:53:46 EST


Richard B. Johnson <root@chaos.analogic.com> wrote:

>Shouldn't the macro be fixed (if broken)? MIN is used a lot in the
>source. Several years ago I made one in which the input parameters were
>not evaluated twice and it was __static__ __inline__. This was not
>accepted, perhaps it's time?

What about:

#define MIN(a,b) ({typeof(a) _a_=(a), _b_=(b); _a_ < _b_ ? _a_ : _b_; })

It's my favourite MIN macro, but it's also a gcc extension.

Peter

-- 
  _   x    ___   p.steiner@t-online.de (Peter Steiner)
 / \_/_\_ /,--' Linux User #55148 (http://counter.li.org/)
 \/>'~~~~//
   \_____/ perl -e'while(<>){s/=\n//g;s/=([\dA-F]{2})/chr(hex($1))/eg;print;}'

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:11 EST