From 411cdf39fc2b961a970a0ae91b9059614251247e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 28 Aug 2012 17:42:54 +0000 Subject: Loads of win32 compilation issues fixed. Most are fairly minor unsigned/signed mismatches because of socket handles, but there were also some order-of-definition issues that were fixed in the FD_SETSIZE definition code. Fixed a few things that just never worked on windows, like Bu::Thread::yield(). --- src/stable/util.h | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'src/stable/util.h') diff --git a/src/stable/util.h b/src/stable/util.h index 087af6e..4514281 100644 --- a/src/stable/util.h +++ b/src/stable/util.h @@ -39,11 +39,6 @@ namespace Bu b = tmp; } -#ifdef WIN32 - #warning: removing min and max win32 macros because of compile conflict - #undef min - #undef max -#endif /** * Finds the lesser of the two objects, objects passed in must be * less-than-comparable. @@ -52,7 +47,7 @@ namespace Bu *@returns A reference to the lesser of a or b. */ template - const item &min( const item &a, const item &b ) + const item &buMin( const item &a, const item &b ) { return a - item &min( item &a, item &b ) + item &buMin( item &a, item &b ) { return a - const item &max( const item &a, const item &b ) + const item &buMax( const item &a, const item &b ) { return b - item &max( item &a, item &b ) + item &buMax( item &a, item &b ) { return b - const item &mid( const item &a, const item &b, const item &c ) + const item &buMid( const item &a, const item &b, const item &c ) { - return min( max( a, b ), c ); + return buMin( buMax( a, b ), c ); } /** @@ -117,9 +112,9 @@ namespace Bu *@returns A reference to the mid-value of a, b, and c. */ template - item &mid( item &a, item &b, item &c ) + item &buMid( item &a, item &b, item &c ) { - return min( max( a, b ), c ); + return buMin( buMax( a, b ), c ); } // -- cgit v1.2.3