Parcourir la source

Avoid redefining MIN/MAX on platforms that have it

- Fixes redefinition warning on OS X.
Nur Monson il y a 12 ans
Parent
commit
579ec87ac7
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 6 2
      Core/Contents/Include/PolyGlobals.h

+ 6 - 2
Core/Contents/Include/PolyGlobals.h

@@ -84,8 +84,12 @@ inline Number clampf(Number x, Number a, Number b)
     return x < a ? a : (x > b ? b : x);
     return x < a ? a : (x > b ? b : x);
 }
 }
 
 
-#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
-#define MAX(a, b)  (((a) > (b)) ? (a) : (b))
+#ifndef MIN
+	#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef MAX
+	#define MAX(a, b)  (((a) > (b)) ? (a) : (b))
+#endif
 
 
 // Special flag read by create_lua_library parser, suppresses Lua bindings for item.
 // Special flag read by create_lua_library parser, suppresses Lua bindings for item.
 #define POLYIGNORE
 #define POLYIGNORE