Browse Source

Try to improve Windows headers handling.

legacy
Sam Hocevar 6 years ago
parent
commit
ddc85c72fa
4 changed files with 31 additions and 10 deletions
  1. +7
    -5
      src/lol/base/assert.h
  2. +5
    -0
      src/lol/engine-internal.h
  3. +12
    -0
      src/lol/math/matrix.h
  4. +7
    -5
      src/lol/sys/thread.h

+ 7
- 5
src/lol/base/assert.h View File

@@ -17,11 +17,13 @@
#include <cstdlib>

#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

namespace lol


+ 5
- 0
src/lol/engine-internal.h View File

@@ -38,3 +38,8 @@
#include <lol/extras.h>
#include <lol/legacy.h>

#if defined _WIN32
# undef near /* Fuck Microsoft */
# undef far /* Fuck Microsoft again */
#endif


+ 12
- 0
src/lol/math/matrix.h View File

@@ -22,6 +22,13 @@
#include <lol/math/vector.h>
#include <lol/math/transform.h>

#if _WIN32
# pragma push_macro("near")
# pragma push_macro("far")
# undef near
# undef far
#endif

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

#if _WIN32
# pragma pop_macro("near")
# pragma pop_macro("far")
#endif


+ 7
- 5
src/lol/sys/thread.h View File

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

/* XXX: workaround for missing std::thread in mingw */


Loading…
Cancel
Save