Index: include/windef.h =================================================================== RCS file: /home/wine/wine/include/windef.h,v retrieving revision 1.58 diff -u -r1.58 windef.h --- include/windef.h 2001/07/30 18:57:18 1.58 +++ include/windef.h 2001/09/15 04:27:51 @@ -126,12 +126,37 @@ /* min and max macros */ #ifndef NOMINMAX + +#if (defined(WINE_MINMAX) || defined(__WINE__)) && defined(__GNUC__) #ifndef max +#define max(x,y) \ + ({ typeof(x) _x = x; \ + typeof(y) _y = y; \ + \ + (void) (&_x == &_y); \ + \ + _x > _y ? _x : _y; \ + }) +#endif +#ifndef min +#define min(x,y) \ + ({ typeof(x) _x = x; \ + typeof(y) _y = y; \ + \ + (void) (&_x == &_y); \ + \ + _x < _y ? _x : _y; \ + }) +#endif +#else +#ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif +#endif + #endif /* NOMINMAX */ #ifndef _MAX_PATH