Index: code/trunk/src/core/input/ExtendedInputState.cc
===================================================================
--- code/trunk/src/core/input/ExtendedInputState.cc	(revision 2762)
+++ code/trunk/src/core/input/ExtendedInputState.cc	(revision 2773)
@@ -35,5 +35,5 @@
 #include "ExtendedInputState.h"
 
-#include <assert.h>
+#include <cassert>
 #include "util/Debug.h"
 
Index: code/trunk/src/network/Client.cc
===================================================================
--- code/trunk/src/network/Client.cc	(revision 2762)
+++ code/trunk/src/network/Client.cc	(revision 2773)
@@ -40,4 +40,5 @@
 
 #include <cassert>
+#include <enet/enet.h>
 
 #include "Client.h"
Index: code/trunk/src/network/Client.h
===================================================================
--- code/trunk/src/network/Client.h	(revision 2762)
+++ code/trunk/src/network/Client.h	(revision 2773)
@@ -50,6 +50,4 @@
 #include "ClientConnection.h"
 #include "GamestateClient.h"
-//#include "NetworkFrameListener.h"
-
 
 
@@ -81,4 +79,5 @@
 
   private:
+    Client(const Client& copy); // not used
     virtual bool isServer_(){return false;}
 
Index: code/trunk/src/network/ClientConnection.cc
===================================================================
--- code/trunk/src/network/ClientConnection.cc	(revision 2762)
+++ code/trunk/src/network/ClientConnection.cc	(revision 2773)
@@ -40,8 +40,10 @@
 #include "ClientConnection.h"
 
+#include <enet/enet.h>
 #include <iostream>
 // boost.thread library for multithreading support
 #include <boost/thread/thread.hpp>
 #include <boost/bind.hpp>
+#include <boost/thread/recursive_mutex.hpp>
 
 #include "util/Sleep.h"
@@ -52,11 +54,12 @@
   //static boost::thread_group network_threads;
 
-  boost::recursive_mutex ClientConnection::enet_mutex_;
+  static boost::recursive_mutex enet_mutex_g;
 
   ClientConnection::ClientConnection(int port, const std::string& address) {
     quit=false;
     server=NULL;
-    enet_address_set_host(&serverAddress, address.c_str());
-    serverAddress.port = port;
+    serverAddress = new ENetAddress();
+    enet_address_set_host(serverAddress, address.c_str());
+    serverAddress->port = port;
     established=false;
   }
@@ -65,6 +68,7 @@
     quit=false;
     server=NULL;
-    enet_address_set_host(&serverAddress, address);
-    serverAddress.port = port;
+    serverAddress = new ENetAddress();
+    enet_address_set_host(serverAddress, address);
+    serverAddress->port = port;
     established=false;
   }
@@ -80,4 +84,5 @@
     if(established)
       closeConnection();
+    delete serverAddress; // surely was created
   }
 
@@ -116,5 +121,5 @@
       return false;
     }
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_);
+    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
     if(enet_peer_send(server, 0, packet)<0)
       return false;
@@ -126,5 +131,5 @@
     if(server==NULL)
       return false;
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_);
+    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
     enet_host_flush(client);
     lock.unlock();
@@ -137,5 +142,5 @@
     ENetEvent *event;
     {
-      boost::recursive_mutex::scoped_lock lock(enet_mutex_);
+      boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
       enet_initialize();
       client = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, 0, 0);
@@ -158,5 +163,5 @@
       //std::cout << "connection loop" << std::endl;
       {
-        boost::recursive_mutex::scoped_lock lock(enet_mutex_);
+        boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
         if(enet_host_service(client, event, NETWORK_CLIENT_WAIT_TIME)<0){
           // we should never reach this point
@@ -192,5 +197,5 @@
     if(!disconnectConnection())
       // if disconnecting failed destroy conn.
-      boost::recursive_mutex::scoped_lock lock(enet_mutex_);
+      boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
       enet_peer_reset(server);
     return;
@@ -199,5 +204,5 @@
   bool ClientConnection::disconnectConnection() {
     ENetEvent event;
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_);
+    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
     enet_peer_disconnect(server, 0);
     while(enet_host_service(client, &event, NETWORK_CLIENT_WAIT_TIME) > 0){
@@ -220,6 +225,6 @@
     ENetEvent event;
     // connect to peer (server is type ENetPeer*)
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_);
-    server = enet_host_connect(client, &serverAddress, NETWORK_CLIENT_CHANNELS);
+    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
+    server = enet_host_connect(client, serverAddress, NETWORK_CLIENT_CHANNELS);
     if(server==NULL) {
       COUT(2) << "ClientConnection: server == NULL" << std::endl;
Index: code/trunk/src/network/ClientConnection.h
===================================================================
--- code/trunk/src/network/ClientConnection.h	(revision 2762)
+++ code/trunk/src/network/ClientConnection.h	(revision 2773)
@@ -44,10 +44,4 @@
 
 #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>
 #include "PacketBuffer.h"
 
@@ -84,4 +78,5 @@
     bool isConnected(){return established;}
   private:
+    ClientConnection(const ClientConnection& copy); // not used
     bool processData(ENetEvent *event);
     // implementation of the listener
@@ -93,5 +88,5 @@
     // enet stuff
     ENetHost *client;
-    ENetAddress serverAddress;
+    ENetAddress *serverAddress;
     // quit-variable (communication with threads)
     bool quit;
@@ -100,7 +95,5 @@
     ENetPeer *server;
     boost::thread *receiverThread_;
-
-    static boost::recursive_mutex enet_mutex_;
-  };
+};
 
 
Index: code/trunk/src/network/ClientInformation.cc
===================================================================
--- code/trunk/src/network/ClientInformation.cc	(revision 2762)
+++ code/trunk/src/network/ClientInformation.cc	(revision 2773)
@@ -41,4 +41,5 @@
 #include "ClientInformation.h"
 
+#include <enet/enet.h>
 #include <iostream> //debug
 
@@ -162,5 +163,5 @@
   }
 
-  enet_uint32 ClientInformation::getRTT(){
+  uint32_t ClientInformation::getRTT(){
     return this->peer_->roundTripTime;
   }
Index: code/trunk/src/network/ClientInformation.h
===================================================================
--- code/trunk/src/network/ClientInformation.h	(revision 2762)
+++ code/trunk/src/network/ClientInformation.h	(revision 2773)
@@ -43,12 +43,4 @@
 #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>
-
-
 // WATCH OUT: THE CLIENTINFORMATION LIST IS NOT THREADSAFE ANYMORE
 
@@ -87,5 +79,5 @@
     void addFailure();
     void resetFailures();
-    enet_uint32 getRTT();
+    uint32_t getRTT();
     double getPacketLoss();
 
Index: code/trunk/src/network/ConnectionManager.cc
===================================================================
--- code/trunk/src/network/ConnectionManager.cc	(revision 2762)
+++ code/trunk/src/network/ConnectionManager.cc	(revision 2773)
@@ -40,9 +40,11 @@
 #include "ConnectionManager.h"
 
+#include <enet/enet.h>
 #include <iostream>
-#include <assert.h>
+#include <cassert>
 // boost.thread library for multithreading support
 #include <boost/thread/thread.hpp>
 #include <boost/bind.hpp>
+#include <boost/thread/recursive_mutex.hpp>
 
 #include "util/Math.h"
@@ -65,4 +67,5 @@
 {
   //boost::thread_group network_threads;
+  static boost::recursive_mutex enet_mutex_g;
 
   ConnectionManager *ConnectionManager::instance_=0;
@@ -72,8 +75,8 @@
     instance_=this;
     quit=false;
-    bindAddress.host = ENET_HOST_ANY;
-    bindAddress.port = NETWORK_PORT;
-  }
-  boost::recursive_mutex ConnectionManager::enet_mutex;
+    bindAddress = new ENetAddress();
+    bindAddress->host = ENET_HOST_ANY;
+    bindAddress->port = NETWORK_PORT;
+  }
 
   ConnectionManager::ConnectionManager(int port){
@@ -81,6 +84,7 @@
     instance_=this;
     quit=false;
-    bindAddress.host = ENET_HOST_ANY;
-    bindAddress.port = port;
+    bindAddress = new ENetAddress();
+    bindAddress->host = ENET_HOST_ANY;
+    bindAddress->port = port;
   }
 
@@ -89,6 +93,7 @@
     instance_=this;
     quit=false;
-    enet_address_set_host (& bindAddress, address.c_str());
-    bindAddress.port = NETWORK_PORT;
+    bindAddress = new ENetAddress();
+    enet_address_set_host (bindAddress, address.c_str());
+    bindAddress->port = NETWORK_PORT;
   }
 
@@ -97,6 +102,7 @@
     instance_=this;
     quit=false;
-    enet_address_set_host (& bindAddress, address);
-    bindAddress.port = NETWORK_PORT;
+    bindAddress = new ENetAddress();
+    enet_address_set_host (bindAddress, address);
+    bindAddress->port = NETWORK_PORT;
   }
 
@@ -105,4 +111,5 @@
       quitListener();
     instance_=0;
+    delete bindAddress;
   }
 
@@ -132,5 +139,5 @@
 
   bool ConnectionManager::addPacket(ENetPacket *packet, ENetPeer *peer) {
-    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
     if(enet_peer_send(peer, NETWORK_DEFAULT_CHANNEL, packet)!=0)
       return false;
@@ -150,5 +157,5 @@
     if(!instance_)
       return false;
-    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
     for(ClientInformation *i=ClientInformation::getBegin()->next(); i!=0; i=i->next()){
       COUT(3) << "adding broadcast packet for client: " << i->getID() << std::endl;
@@ -163,5 +170,5 @@
     if(server==NULL || !instance_)
       return false;
-    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
     enet_host_flush(server);
     lock.unlock();
@@ -174,7 +181,7 @@
     atexit(enet_deinitialize);
     { //scope of the mutex
-      boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
+      boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
       enet_initialize();
-      server = enet_host_create(&bindAddress, NETWORK_MAX_CONNECTIONS, 0, 0);
+      server = enet_host_create(bindAddress, NETWORK_MAX_CONNECTIONS, 0, 0);
       lock.unlock();
     }
@@ -188,5 +195,5 @@
     while(!quit){
       { //mutex scope
-        boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
+        boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
         if(enet_host_service(server, event, NETWORK_WAIT_TIMEOUT)<0){
           // we should never reach this point
@@ -216,5 +223,5 @@
     // if we're finishied, destroy server
     {
-      boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
+      boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
       enet_host_destroy(server);
       lock.unlock();
@@ -230,5 +237,5 @@
     while(temp!=0){
       {
-        boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
+        boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
         enet_peer_disconnect(temp->getPeer(), 0);
         lock.unlock();
@@ -238,5 +245,5 @@
     //bugfix: might be the reason why server crashes when clients disconnects
     temp = ClientInformation::getBegin()->next();
-    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
     while( temp!=0 && enet_host_service(server, &event, NETWORK_WAIT_TIMEOUT) >= 0){
       switch (event.type)
@@ -267,10 +274,10 @@
 
 
-  int ConnectionManager::getClientID(ENetPeer peer) {
-    return getClientID(peer.address);
-  }
-
-  int ConnectionManager::getClientID(ENetAddress address) {
-    return ClientInformation::findClient(&address)->getID();
+  int ConnectionManager::getClientID(ENetPeer* peer) {
+    return getClientID(&(peer->address));
+  }
+
+  int ConnectionManager::getClientID(ENetAddress* address) {
+    return ClientInformation::findClient(address)->getID();
   }
 
@@ -294,5 +301,5 @@
   void ConnectionManager::disconnectClient(ClientInformation *client){
     {
-      boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
+      boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
       enet_peer_disconnect(client->getPeer(), 0);
       lock.unlock();
Index: code/trunk/src/network/ConnectionManager.h
===================================================================
--- code/trunk/src/network/ConnectionManager.h	(revision 2762)
+++ code/trunk/src/network/ConnectionManager.h	(revision 2773)
@@ -45,11 +45,4 @@
 #include <string>
 #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>
 
 #include "PacketBuffer.h"
@@ -57,9 +50,4 @@
 
 namespace boost { class thread; }
-
-namespace std
-{
-  bool operator<(ENetAddress a, ENetAddress b);
-}
 
 namespace orxonox
@@ -78,5 +66,4 @@
   class _NetworkExport ConnectionManager{
     public:
-    static boost::recursive_mutex enet_mutex;
     ConnectionManager();
     ConnectionManager(int port);
@@ -96,14 +83,15 @@
 
   private:
+    ConnectionManager(const ConnectionManager& copy); // not used
     bool processData(ENetEvent *event);
     void receiverThread();
     void disconnectClients();
-    int getClientID(ENetPeer peer);
-    int getClientID(ENetAddress address);
+    int getClientID(ENetPeer* peer);
+    int getClientID(ENetAddress* address);
     ENetPeer *getClientPeer(int clientID);
     PacketBuffer buffer;
 
     ENetHost *server;
-    ENetAddress bindAddress;
+    ENetAddress *bindAddress;
 
     bool quit; // quit-variable (communication with threads)
Index: code/trunk/src/network/GamestateHandler.cc
===================================================================
--- code/trunk/src/network/GamestateHandler.cc	(revision 2762)
+++ code/trunk/src/network/GamestateHandler.cc	(revision 2773)
@@ -1,3 +1,3 @@
-#include <assert.h>
+#include <cassert>
 
 #include "GamestateHandler.h"
Index: code/trunk/src/network/Host.cc
===================================================================
--- code/trunk/src/network/Host.cc	(revision 2762)
+++ code/trunk/src/network/Host.cc	(revision 2773)
@@ -27,5 +27,5 @@
  */
 
-#include <assert.h>
+#include <cassert>
 
 #include "Host.h"
Index: code/trunk/src/network/NetworkPrereqs.h
===================================================================
--- code/trunk/src/network/NetworkPrereqs.h	(revision 2762)
+++ code/trunk/src/network/NetworkPrereqs.h	(revision 2773)
@@ -69,4 +69,17 @@
 // Forward declarations
 //-----------------------------------------------------------------------
+
+// from ENet
+struct _ENetPeer;
+typedef _ENetPeer ENetPeer;
+struct _ENetPacket;
+typedef _ENetPacket ENetPacket;
+struct _ENetEvent;
+typedef _ENetEvent ENetEvent;
+struct _ENetHost;
+typedef _ENetHost ENetHost;
+struct _ENetAddress;
+typedef _ENetAddress ENetAddress;
+
 namespace orxonox
 {
Index: code/trunk/src/network/PacketBuffer.cc
===================================================================
--- code/trunk/src/network/PacketBuffer.cc	(revision 2762)
+++ code/trunk/src/network/PacketBuffer.cc	(revision 2773)
@@ -33,4 +33,5 @@
 #include "PacketBuffer.h"
 
+#include <enet/enet.h>
 #include <iostream>
 #include <queue>
@@ -38,8 +39,9 @@
 #include <boost/bind.hpp>
 #include <boost/thread/mutex.hpp>
+#include <boost/thread/recursive_mutex.hpp>
 
 namespace orxonox
 {
-   boost::recursive_mutex PacketBuffer::mutex_;
+  static boost::recursive_mutex packetBuffer_mutex_g;
 
   PacketBuffer::PacketBuffer() {
@@ -52,5 +54,5 @@
 
   bool PacketBuffer::push(ENetEvent *ev) {
-    boost::recursive_mutex::scoped_lock lock(mutex_);
+    boost::recursive_mutex::scoped_lock lock(packetBuffer_mutex_g);
     //std::cout << "event size inside packetbuffer " << ev->packet->dataLength << std::endl;
     //   if(closed)
@@ -86,5 +88,5 @@
   
   ENetEvent *PacketBuffer::pop(){
-    boost::recursive_mutex::scoped_lock lock(mutex_);
+    boost::recursive_mutex::scoped_lock lock(packetBuffer_mutex_g);
     //std::cout << "packetbuffer pop(address)" << std::endl;
     if(first!=NULL /*&& !closed*/){
@@ -106,5 +108,5 @@
 
   /*ENetPacket *PacketBuffer::pop(ENetAddress &address) {
-    boost::recursive_mutex::scoped_lock lock(mutex_);
+    boost::recursive_mutex::scoped_lock lock(packetBuffer_mutex_g);
     //std::cout << "packetbuffer pop(address)" << std::endl;
     if(first!=NULL ){
Index: code/trunk/src/network/PacketBuffer.h
===================================================================
--- code/trunk/src/network/PacketBuffer.h	(revision 2762)
+++ code/trunk/src/network/PacketBuffer.h	(revision 2773)
@@ -44,11 +44,4 @@
 #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>
-
 namespace orxonox
 {
@@ -82,5 +75,4 @@
     QueueItem *last;
     bool closed;
-    static boost::recursive_mutex mutex_;
   };
 
Index: code/trunk/src/network/Server.cc
===================================================================
--- code/trunk/src/network/Server.cc	(revision 2762)
+++ code/trunk/src/network/Server.cc	(revision 2773)
@@ -41,4 +41,5 @@
 #include "Server.h"
 
+#include <enet/enet.h>
 #include <iostream>
 #include <cassert>
@@ -57,5 +58,5 @@
 #include "packet/Welcome.h"
 #include "packet/DeleteObjects.h"
-#include <util/Convert.h>
+#include "util/Convert.h"
 #include "ChatListener.h"
 
Index: code/trunk/src/network/packet/Chat.cc
===================================================================
--- code/trunk/src/network/packet/Chat.cc	(revision 2762)
+++ code/trunk/src/network/packet/Chat.cc	(revision 2773)
@@ -28,5 +28,7 @@
 
 #include "Chat.h"
-#include <assert.h>
+
+#include <enet/enet.h>
+#include <cassert>
 #include "network/Host.h"
 
Index: code/trunk/src/network/packet/ClassID.cc
===================================================================
--- code/trunk/src/network/packet/ClassID.cc	(revision 2762)
+++ code/trunk/src/network/packet/ClassID.cc	(revision 2773)
@@ -30,9 +30,10 @@
 
 #include "ClassID.h"
+#include <enet/enet.h>
 #include "core/CoreIncludes.h"
 #include "core/Factory.h"
 #include <cstring>
 #include <string>
-#include <assert.h>
+#include <cassert>
 #include <map>
 #include <queue>
Index: code/trunk/src/network/packet/DeleteObjects.cc
===================================================================
--- code/trunk/src/network/packet/DeleteObjects.cc	(revision 2762)
+++ code/trunk/src/network/packet/DeleteObjects.cc	(revision 2773)
@@ -29,12 +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"
 #include "core/CoreIncludes.h"
-#include <assert.h>
+#include <cassert>
 
 namespace orxonox {
Index: code/trunk/src/network/packet/Gamestate.cc
===================================================================
--- code/trunk/src/network/packet/Gamestate.cc	(revision 2762)
+++ code/trunk/src/network/packet/Gamestate.cc	(revision 2773)
@@ -28,4 +28,7 @@
 
 #include "Gamestate.h"
+#include <enet/enet.h>
+#include <zlib.h>
+#include <cassert>
 #include "../GamestateHandler.h"
 #include "../synchronisable/Synchronisable.h"
@@ -35,6 +38,4 @@
 #include "core/Iterator.h"
 
-#include <zlib.h>
-#include <cassert>
 
 
Index: code/trunk/src/network/packet/Packet.cc
===================================================================
--- code/trunk/src/network/packet/Packet.cc	(revision 2762)
+++ code/trunk/src/network/packet/Packet.cc	(revision 2773)
@@ -31,10 +31,7 @@
 
 #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>
+#include <boost/thread/recursive_mutex.hpp>
 
 #include "network/ConnectionManager.h"
@@ -58,5 +55,6 @@
 
 std::map<size_t, Packet *> Packet::packetMap_;
-boost::recursive_mutex Packet::packetMap_mutex;
+//! Static mutex for any packetMap_ access
+static boost::recursive_mutex packetMap_mutex_g;
 
 Packet::Packet(){
@@ -142,5 +140,5 @@
       // Assures we don't create a packet and destroy it right after in another thread
       // without having a reference in the packetMap_
-      boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex);
+      boost::recursive_mutex::scoped_lock lock(packetMap_mutex_g);
       packetMap_[(size_t)(void*)enetPacket_] = this;
     }
@@ -217,5 +215,5 @@
 */
 void Packet::deletePacket(ENetPacket *enetPacket){
-  boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex);
+  boost::recursive_mutex::scoped_lock lock(packetMap_mutex_g);
   // Get our Packet from a gloabal map with all Packets created in the send() method of Packet.
   std::map<size_t, Packet*>::iterator it = packetMap_.find((size_t)enetPacket);
Index: code/trunk/src/network/packet/Packet.h
===================================================================
--- code/trunk/src/network/packet/Packet.h	(revision 2762)
+++ code/trunk/src/network/packet/Packet.h	(revision 2773)
@@ -32,10 +32,4 @@
 
 #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>
 
 namespace orxonox {
@@ -72,5 +66,5 @@
     virtual unsigned int getSize() const =0;
     virtual bool process()=0;
-    enet_uint32 getFlags()
+    uint32_t getFlags()
       { return flags_; }
     int getClientID()
@@ -84,5 +78,5 @@
     Packet(uint8_t *data, unsigned int clientID);
 //    Packet(ENetPacket *packet, ENetPeer *peer);
-    enet_uint32 flags_;
+    uint32_t flags_;
     unsigned int clientID_;
     ENUM::Direction packetDirection_;
@@ -96,6 +90,4 @@
   private:
     static std::map<size_t, Packet *> packetMap_;
-    //! Static mutex for any packetMap_ access
-    static boost::recursive_mutex packetMap_mutex;
     ENetPacket *enetPacket_;
 };
Index: code/trunk/src/network/packet/Welcome.cc
===================================================================
--- code/trunk/src/network/packet/Welcome.cc	(revision 2762)
+++ code/trunk/src/network/packet/Welcome.cc	(revision 2773)
@@ -31,8 +31,9 @@
 
 #include "Welcome.h"
+#include <enet/enet.h>
+#include <cassert>
 #include "network/Host.h"
 #include "network/synchronisable/Synchronisable.h"
 #include "core/CoreIncludes.h"
-#include <assert.h>
 
 namespace orxonox {
Index: code/trunk/src/network/synchronisable/Synchronisable.cc
===================================================================
--- code/trunk/src/network/synchronisable/Synchronisable.cc	(revision 2762)
+++ code/trunk/src/network/synchronisable/Synchronisable.cc	(revision 2773)
@@ -34,5 +34,5 @@
 #include <string>
 #include <iostream>
-#include <assert.h>
+#include <cassert>
 
 #include "core/CoreIncludes.h"
Index: code/trunk/src/network/synchronisable/Synchronisable.h
===================================================================
--- code/trunk/src/network/synchronisable/Synchronisable.h	(revision 2762)
+++ code/trunk/src/network/synchronisable/Synchronisable.h	(revision 2773)
@@ -39,8 +39,4 @@
 #include "util/mbool.h"
 #include "core/OrxonoxClass.h"
-// TODO: this has to be removed
-// #include <OgreLight.h>
-// #include "OrxonoxPrereqs.h"
-// ============================
 #include "NetworkCallback.h"
 #include "SynchronisableVariable.h"
Index: code/trunk/src/util/CMakeLists.txt
===================================================================
--- code/trunk/src/util/CMakeLists.txt	(revision 2762)
+++ code/trunk/src/util/CMakeLists.txt	(revision 2773)
@@ -47,4 +47,5 @@
   OutputHandler.cc
   SignalHandler.cc
+  Sleep.cc
   String.cc
   SubString.cc
Index: code/trunk/src/util/Sleep.cc
===================================================================
--- code/trunk/src/util/Sleep.cc	(revision 2773)
+++ code/trunk/src/util/Sleep.cc	(revision 2773)
@@ -0,0 +1,79 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of three sleep functions.
+*/
+
+#include "Sleep.h"
+#include "Debug.h"
+
+#ifdef ORXONOX_PLATFORM_WINDOWS
+#include <windows.h>
+
+namespace orxonox
+{
+    void usleep(unsigned long microseconds)
+    {
+        if (microseconds < 1000)
+            COUT(2) << "Warning: Windows can not sleep less than 1ms, ignoring" << std::endl;
+        Sleep(microseconds / 1000);
+    }
+
+    void msleep(unsigned long milliseconds)
+    {
+        Sleep(milliseconds);
+    }
+
+    void sleep(unsigned long seconds)
+    {
+        Sleep(seconds * 1000);
+    }
+}
+
+#else /* Linux/Apple */
+#include <unistd.h>
+
+namespace orxonox
+{
+    inline void usleep(unsigned long usec)
+    {
+        ::usleep(usec);
+    }
+    inline void msleep(unsigned long msec)
+    {
+        ::usleep(msec * 1000);
+    }
+    inline void sleep(unsigned long sec)
+    {
+        ::usleep(sec * 1000000);
+    }
+}
+
+#endif
Index: code/trunk/src/util/Sleep.h
===================================================================
--- code/trunk/src/util/Sleep.h	(revision 2762)
+++ code/trunk/src/util/Sleep.h	(revision 2773)
@@ -30,5 +30,5 @@
  @file
  @brief
-    Functions for using sleep() and usleep() under windows.
+    Functions for using sleep() and usleep() on windows.
  */
 
@@ -38,46 +38,10 @@
 #include "UtilPrereqs.h"
 
-#ifdef ORXONOX_PLATFORM_WINDOWS
-#include <winbase.h>
-
 namespace orxonox
 {
-    inline void usleep(DWORD dwMicroseconds)
-    {
-        Sleep(dwMicroseconds / 1000);
-    }
-
-    inline void msleep(DWORD dwMilliseconds)
-    {
-        Sleep(dwMilliseconds);
-    }
-
-    inline void sleep(DWORD dwSeconds)
-    {
-        Sleep(dwSeconds * 1000);
-    }
+    _UtilExport void usleep(unsigned long microseconds);
+    _UtilExport void msleep(unsigned long milliseconds);
+    _UtilExport void sleep (unsigned long seconds);
 }
 
-#else /* Linux/Apple */
-
-#include <unistd.h>
-
-namespace orxonox
-{
-    inline void usleep(unsigned long usec)
-    {
-        ::usleep(usec);
-    }
-    inline void msleep(unsigned long msec)
-    {
-        ::usleep(msec * 1000);
-    }
-    inline void sleep(unsigned long sec)
-    {
-        ::usleep(sec * 1000000);
-    }
-}
-
-#endif
-
 #endif /* _Sleep_H__ */
