Просмотр исходного кода

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 12 лет назад
Родитель
Сommit
0c04e84378
1 измененных файлов с 3 добавлено и 0 удалено
  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:4309)
 	#define NULL 0
+	// Prevent windows.h includes from generating min/max macros that
+	// clash with the templates in <algorithm>
+	#define NOMINMAX
 
 
 #endif