@@ -17,11 +17,13 @@ | |||||
#include <cstdlib> | #include <cstdlib> | ||||
#if defined _WIN32 | #if defined _WIN32 | ||||
# define WIN32_LEAN_AND_MEAN 1 | |||||
# include <windows.h> | |||||
# undef WIN32_LEAN_AND_MEAN | |||||
# undef near /* Fuck Microsoft */ | |||||
# undef far /* Fuck Microsoft again */ | |||||
# ifdef WIN32_LEAN_AND_MEAN | |||||
# include <windows.h> | |||||
# else | |||||
# define WIN32_LEAN_AND_MEAN 1 | |||||
# include <windows.h> | |||||
# undef WIN32_LEAN_AND_MEAN | |||||
# endif | |||||
#endif | #endif | ||||
namespace lol | namespace lol | ||||
@@ -38,3 +38,8 @@ | |||||
#include <lol/extras.h> | #include <lol/extras.h> | ||||
#include <lol/legacy.h> | #include <lol/legacy.h> | ||||
#if defined _WIN32 | |||||
# undef near /* Fuck Microsoft */ | |||||
# undef far /* Fuck Microsoft again */ | |||||
#endif | |||||
@@ -22,6 +22,13 @@ | |||||
#include <lol/math/vector.h> | #include <lol/math/vector.h> | ||||
#include <lol/math/transform.h> | #include <lol/math/transform.h> | ||||
#if _WIN32 | |||||
# pragma push_macro("near") | |||||
# pragma push_macro("far") | |||||
# undef near | |||||
# undef far | |||||
#endif | |||||
namespace lol | namespace lol | ||||
{ | { | ||||
@@ -845,3 +852,8 @@ mat_t<T,4,4> const mat_t<T,4,4>::identity = mat_t<T,4,4>((T)1); | |||||
} /* namespace lol */ | } /* namespace lol */ | ||||
#if _WIN32 | |||||
# pragma pop_macro("near") | |||||
# pragma pop_macro("far") | |||||
#endif | |||||
@@ -31,11 +31,13 @@ | |||||
* https://connect.microsoft.com/VisualStudio/feedback/details/747145 */ | * https://connect.microsoft.com/VisualStudio/feedback/details/747145 */ | ||||
#if defined(_MSC_VER) && (_MSC_VER < 1900) | #if defined(_MSC_VER) && (_MSC_VER < 1900) | ||||
# define LOL_VISUAL_STUDIO_BUG_747145_WORKAROUND 1 | # define LOL_VISUAL_STUDIO_BUG_747145_WORKAROUND 1 | ||||
# define WIN32_LEAN_AND_MEAN 1 | |||||
# include <windows.h> | |||||
# undef WIN32_LEAN_AND_MEAN | |||||
# undef near /* Fuck Microsoft */ | |||||
# undef far /* Fuck Microsoft again */ | |||||
# ifdef WIN32_LEAN_AND_MEAN | |||||
# include <windows.h> | |||||
# else | |||||
# define WIN32_LEAN_AND_MEAN 1 | |||||
# include <windows.h> | |||||
# undef WIN32_LEAN_AND_MEAN | |||||
# endif | |||||
#endif | #endif | ||||
/* XXX: workaround for missing std::thread in mingw */ | /* XXX: workaround for missing std::thread in mingw */ | ||||