Parcourir la source

Add definition to suppress min/max macros on Windows

- When you include windows.h it will define a pair
  of min/max macros. This becomes a problem when you
  want to use the min/max defined as templates in
  <algorithm>. The templates are preferred as you
  only calculate the values of the arguments once
  rather than the two times that the macro does.
Nur Monson il y a 12 ans
Parent
commit
0c04e84378
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      Core/Contents/Include/PolyGlobals.h

+ 3 - 0
Core/Contents/Include/PolyGlobals.h

@@ -39,6 +39,9 @@ THE SOFTWARE.
 	#pragma warning(disable:4996)
 	#pragma warning(disable:4996)
 	#pragma warning(disable:4309)
 	#pragma warning(disable:4309)
 	#define NULL 0
 	#define NULL 0
+	// Prevent windows.h includes from generating min/max macros that
+	// clash with the templates in <algorithm>
+	#define NOMINMAX
 
 
 
 
 #endif
 #endif