From 1bc2a7d705371180a4da058ac8df4e2e047889a4 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 30 Apr 2012 09:48:55 +0000 Subject: [PATCH] build: fix compilation on Windows by undefining the min and max macros that WinDef.h insists on shoving down our throats. --- src/lol/math/half.h | 4 ++++ src/lol/math/real.h | 10 +++++++--- src/lol/math/vector.h | 4 ++++ win32/lolcore.vcxproj.filters | 6 ++++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/lol/math/half.h b/src/lol/math/half.h index 531295bf..172c4f13 100644 --- a/src/lol/math/half.h +++ b/src/lol/math/half.h @@ -22,6 +22,10 @@ namespace lol { +/* This is OUR namespace. Don't let Windows headers fuck with it. */ +#undef min +#undef max + class half { public: diff --git a/src/lol/math/real.h b/src/lol/math/real.h index 5546b6d0..339db257 100644 --- a/src/lol/math/real.h +++ b/src/lol/math/real.h @@ -18,12 +18,16 @@ #include -/* Avoid issues with NaCl headers */ -#undef log2 - namespace lol { +/* This is OUR namespace. Don't let Windows headers fuck with it. */ +#undef min +#undef max + +/* Avoid issues with NaCl headers */ +#undef log2 + /* * The base class for reals. The only real reason for making this a template * class is so we can have implicit constructors ("real x = 1" works) but diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index 1bf5be72..9df2077a 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -28,6 +28,10 @@ namespace lol { +/* This is OUR namespace. Don't let Windows headers fuck with it. */ +#undef min +#undef max + /* Some compilers do not support const members in anonymous unions. So * far, GCC (>= 4.6), CLang (3.0) and Visual Studio (>= 2010) appear to * work properly. */ diff --git a/win32/lolcore.vcxproj.filters b/win32/lolcore.vcxproj.filters index 9a62fa89..5acb9d74 100644 --- a/win32/lolcore.vcxproj.filters +++ b/win32/lolcore.vcxproj.filters @@ -363,12 +363,14 @@ src\platform\xbox - src\gpu src + + src\lol + - + \ No newline at end of file