Browse Source

build: fix compilation on Windows by undefining the min and max macros

that WinDef.h insists on shoving down our throats.
legacy
Sam Hocevar sam 12 years ago
parent
commit
1bc2a7d705
4 changed files with 19 additions and 5 deletions
  1. +4
    -0
      src/lol/math/half.h
  2. +7
    -3
      src/lol/math/real.h
  3. +4
    -0
      src/lol/math/vector.h
  4. +4
    -2
      win32/lolcore.vcxproj.filters

+ 4
- 0
src/lol/math/half.h View File

@@ -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:


+ 7
- 3
src/lol/math/real.h View File

@@ -18,12 +18,16 @@

#include <stdint.h>

/* 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


+ 4
- 0
src/lol/math/vector.h View File

@@ -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. */


+ 4
- 2
win32/lolcore.vcxproj.filters View File

@@ -363,12 +363,14 @@
<ClInclude Include="..\src\platform\xbox\xboxapp.h">
<Filter>src\platform\xbox</Filter>
</ClInclude>
<ClInclude Include="..\src\lol\debug.h" />
<ClInclude Include="..\src\gpu\indexbuffer.h">
<Filter>src\gpu</Filter>
</ClInclude>
<ClInclude Include="..\src\array.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\src\lol\debug.h">
<Filter>src\lol</Filter>
</ClInclude>
</ItemGroup>
</Project>
</Project>

Loading…
Cancel
Save