min and max changed to vncmin and vncmax. This solves many problems: Some platforms predefines or redefines these symbols. Some platforms have header files which chokes if min or max are defined.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@96 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfb/util.h b/rfb/util.h
index d792c8d..b654170 100644
--- a/rfb/util.h
+++ b/rfb/util.h
@@ -23,6 +23,13 @@
 #ifndef __RFB_UTIL_H__
 #define __RFB_UTIL_H__
 
+#ifndef vncmin
+#define vncmin(a,b)            (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef vncmax
+#define vncmax(a,b)            (((a) > (b)) ? (a) : (b))
+#endif
+
 #include <string.h>
 
 namespace rfb {
@@ -67,21 +74,6 @@
 }
 #endif
 
-// Some platforms (e.g. Windows) include max() and min() macros in their
-// standard headers, so we define them only when not already defined.  Note
-// also that max() & min() are standard C++ template functions, so some C++
-// headers will undefine them.  We place our definitions outside the #ifndef
-// __RFB_UTIL_H__, so that you can always guarantee they will be defined if
-// this file is the last #include before you use them.
-
-#ifndef max
-#define max(a,b)            (((a) > (b)) ? (a) : (b))
-#endif
-
-#ifndef min
-#define min(a,b)            (((a) < (b)) ? (a) : (b))
-#endif
-
 
 // -=- PLATFORM SPECIFIC UTILITY FUNCTIONS/IMPLEMENTATIONS
 #ifdef WIN32