[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
definition of MAX and MIN Macros
From: |
Marc Brünink |
Subject: |
definition of MAX and MIN Macros |
Date: |
Thu, 24 Aug 2006 12:23:16 +0200 |
User-agent: |
Thunderbird 1.5 (X11/20060113) |
Hi all,
This Code does not work on Solaris 10 x86:
#define MIN(a,b) \
({typeof(a) _MIN_a = (a); typeof(b) _MIN_b = (b); \
_MIN_a < _MIN_b ? _MIN_a : _MIN_b; })
But this one does:
#define MIN(a,b) ( a < b ? a : b)
So why the heck do we use all this typeof stuff?
Thanks
Marc
- definition of MAX and MIN Macros,
Marc Brünink <=