diff --git a/src/lol/base/assert.h b/src/lol/base/assert.h index d03cd2a6..663646fd 100644 --- a/src/lol/base/assert.h +++ b/src/lol/base/assert.h @@ -17,11 +17,13 @@ #include #if defined _WIN32 -# define WIN32_LEAN_AND_MEAN 1 -# include -# undef WIN32_LEAN_AND_MEAN -# undef near /* Fuck Microsoft */ -# undef far /* Fuck Microsoft again */ +# ifdef WIN32_LEAN_AND_MEAN +# include +# else +# define WIN32_LEAN_AND_MEAN 1 +# include +# undef WIN32_LEAN_AND_MEAN +# endif #endif namespace lol diff --git a/src/lol/engine-internal.h b/src/lol/engine-internal.h index 64ed7e2f..175a87de 100644 --- a/src/lol/engine-internal.h +++ b/src/lol/engine-internal.h @@ -38,3 +38,8 @@ #include #include +#if defined _WIN32 +# undef near /* Fuck Microsoft */ +# undef far /* Fuck Microsoft again */ +#endif + diff --git a/src/lol/math/matrix.h b/src/lol/math/matrix.h index 5ff32afc..12018d2f 100644 --- a/src/lol/math/matrix.h +++ b/src/lol/math/matrix.h @@ -22,6 +22,13 @@ #include #include +#if _WIN32 +# pragma push_macro("near") +# pragma push_macro("far") +# undef near +# undef far +#endif + namespace lol { @@ -845,3 +852,8 @@ mat_t const mat_t::identity = mat_t((T)1); } /* namespace lol */ +#if _WIN32 +# pragma pop_macro("near") +# pragma pop_macro("far") +#endif + diff --git a/src/lol/sys/thread.h b/src/lol/sys/thread.h index 7ab05517..2a9e1ac2 100644 --- a/src/lol/sys/thread.h +++ b/src/lol/sys/thread.h @@ -31,11 +31,13 @@ * https://connect.microsoft.com/VisualStudio/feedback/details/747145 */ #if defined(_MSC_VER) && (_MSC_VER < 1900) # define LOL_VISUAL_STUDIO_BUG_747145_WORKAROUND 1 -# define WIN32_LEAN_AND_MEAN 1 -# include -# undef WIN32_LEAN_AND_MEAN -# undef near /* Fuck Microsoft */ -# undef far /* Fuck Microsoft again */ +# ifdef WIN32_LEAN_AND_MEAN +# include +# else +# define WIN32_LEAN_AND_MEAN 1 +# include +# undef WIN32_LEAN_AND_MEAN +# endif #endif /* XXX: workaround for missing std::thread in mingw */