Index: /code/trunk/src/network/ClientConnection.h
===================================================================
--- /code/trunk/src/network/ClientConnection.h	(revision 2755)
+++ /code/trunk/src/network/ClientConnection.h	(revision 2756)
@@ -44,4 +44,8 @@
 
 #include <string>
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#endif
+#define NOMINMAX // required to stop windows.h screwing up std::min definition
 #include <enet/enet.h>
 #include <boost/thread/recursive_mutex.hpp>
Index: /code/trunk/src/network/ClientInformation.h
===================================================================
--- /code/trunk/src/network/ClientInformation.h	(revision 2755)
+++ /code/trunk/src/network/ClientInformation.h	(revision 2756)
@@ -43,4 +43,8 @@
 #include "NetworkPrereqs.h"
 
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#endif
+#define NOMINMAX // required to stop windows.h screwing up std::min definition
 #include <enet/enet.h>
 #include <boost/thread/recursive_mutex.hpp>
Index: /code/trunk/src/network/ConnectionManager.h
===================================================================
--- /code/trunk/src/network/ConnectionManager.h	(revision 2755)
+++ /code/trunk/src/network/ConnectionManager.h	(revision 2756)
@@ -46,4 +46,8 @@
 #include <map>
 // enet library for networking support
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#endif
+#define NOMINMAX // required to stop windows.h screwing up std::min definition
 #include <enet/enet.h>
 #include <boost/thread/recursive_mutex.hpp>
Index: /code/trunk/src/network/PacketBuffer.h
===================================================================
--- /code/trunk/src/network/PacketBuffer.h	(revision 2755)
+++ /code/trunk/src/network/PacketBuffer.h	(revision 2756)
@@ -44,4 +44,8 @@
 #include "NetworkPrereqs.h"
 
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#endif
+#define NOMINMAX // required to stop windows.h screwing up std::min definition
 #include <enet/enet.h>
 #include <boost/thread/recursive_mutex.hpp>
Index: /code/trunk/src/network/packet/DeleteObjects.cc
===================================================================
--- /code/trunk/src/network/packet/DeleteObjects.cc	(revision 2755)
+++ /code/trunk/src/network/packet/DeleteObjects.cc	(revision 2756)
@@ -29,4 +29,8 @@
 
 #include "DeleteObjects.h"
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#endif
+#define NOMINMAX // required to stop windows.h screwing up std::min definition
 #include <enet/enet.h>
 #include "network/synchronisable/Synchronisable.h"
Index: /code/trunk/src/network/packet/Packet.cc
===================================================================
--- /code/trunk/src/network/packet/Packet.cc	(revision 2755)
+++ /code/trunk/src/network/packet/Packet.cc	(revision 2756)
@@ -31,4 +31,8 @@
 
 #include <cassert>
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#endif
+#define NOMINMAX // required to stop windows.h screwing up std::min definition
 #include <enet/enet.h>
 #include <boost/bind.hpp>
Index: /code/trunk/src/network/packet/Packet.h
===================================================================
--- /code/trunk/src/network/packet/Packet.h	(revision 2755)
+++ /code/trunk/src/network/packet/Packet.h	(revision 2756)
@@ -32,4 +32,8 @@
 
 #include <map>
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#endif
+#define NOMINMAX // required to stop windows.h screwing up std::min definition
 #include <enet/enet.h>
 #include <boost/thread/recursive_mutex.hpp>
Index: /code/trunk/src/orxonox/gamestates/GSGraphics.h
===================================================================
--- /code/trunk/src/orxonox/gamestates/GSGraphics.h	(revision 2755)
+++ /code/trunk/src/orxonox/gamestates/GSGraphics.h	(revision 2756)
@@ -32,4 +32,5 @@
 #include "OrxonoxPrereqs.h"
 #include <OgrePrerequisites.h>
+#define NOMINMAX // required to stop windows.h screwing up std::min definition
 #include <OgreWindowEventUtilities.h>
 #include "core/GameState.h"
Index: /code/trunk/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- /code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 2755)
+++ /code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 2756)
@@ -49,13 +49,6 @@
 #    define WIN32_LEAN_AND_MEAN
 #  endif
+#  define NOMINMAX // required to stop windows.h screwing up std::min definition
 #  include "windows.h"
-
-   //Get around Windows hackery
-#  ifdef max
-#    undef max
-#  endif
-#  ifdef min
-#    undef min
-#  endif
 #endif
 
Index: /code/trunk/src/orxonox/pch/havepch/OrxonoxStableHeaders.h
===================================================================
--- /code/trunk/src/orxonox/pch/havepch/OrxonoxStableHeaders.h	(revision 2755)
+++ /code/trunk/src/orxonox/pch/havepch/OrxonoxStableHeaders.h	(revision 2756)
@@ -45,4 +45,5 @@
 #  define WIN32_LEAN_AND_MEAN
 #endif
+#define NOMINMAX // required to stop windows.h screwing up std::min definition
 #include <Ogre.h>
 #include <CEGUI.h>
@@ -57,14 +58,4 @@
 #include <tinyxml/ticpp.h>
 #include <tolua++.h>
-
-//Get around Windows hackery (windows.h is included by Ogre.h)
-#ifdef ORXONOX_PLATFORM_WINDOWS 
-#  ifdef max
-#    undef max
-#  endif
-#  ifdef min
-#    undef min
-#  endif
-#endif
 
 //----------- Our files ----------
Index: /code/trunk/src/util/Math.h
===================================================================
--- /code/trunk/src/util/Math.h	(revision 2755)
+++ /code/trunk/src/util/Math.h	(revision 2756)
@@ -51,12 +51,7 @@
 #include <OgreColourValue.h>
 
-//Get around Windows hackery
-#ifdef ORXONOX_PLATFORM_WINDOWS
-#  ifdef max
-#    undef max
-#  endif
-#  ifdef min
-#    undef min
-#  endif
+// Certain headers might define min and max macros
+#if defined(max) || defined(min) || defined(sgn) || defined(clamp) || defined(square) || defined(mod)
+#  error An inline math function was overridden by a macro
 #endif
 
