Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 11, 2009, 4:06:31 PM (15 years ago)
Author:
rgrieder
Message:

Removed all enet and boost includes from header files in the network library.

  • Reduces dependencies
  • Minimises problems with windows.h
  • Speeds up the compiling process a little bit (probably negligible)
  • Also removes ugly WIN32_LEAN_AND_MEAN declarations before every enet.h include in the network library.

Removed windows.h header from util/Sleep.h by adding Sleep.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/network/packet/Packet.cc

    r2756 r2773  
    3131
    3232#include <cassert>
    33 #ifndef WIN32_LEAN_AND_MEAN
    34 #  define WIN32_LEAN_AND_MEAN
    35 #endif
    36 #define NOMINMAX // required to stop windows.h screwing up std::min definition
    3733#include <enet/enet.h>
    3834#include <boost/bind.hpp>
     35#include <boost/thread/recursive_mutex.hpp>
    3936
    4037#include "network/ConnectionManager.h"
     
    5855
    5956std::map<size_t, Packet *> Packet::packetMap_;
    60 boost::recursive_mutex Packet::packetMap_mutex;
     57//! Static mutex for any packetMap_ access
     58static boost::recursive_mutex packetMap_mutex_g;
    6159
    6260Packet::Packet(){
     
    142140      // Assures we don't create a packet and destroy it right after in another thread
    143141      // without having a reference in the packetMap_
    144       boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex);
     142      boost::recursive_mutex::scoped_lock lock(packetMap_mutex_g);
    145143      packetMap_[(size_t)(void*)enetPacket_] = this;
    146144    }
     
    217215*/
    218216void Packet::deletePacket(ENetPacket *enetPacket){
    219   boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex);
     217  boost::recursive_mutex::scoped_lock lock(packetMap_mutex_g);
    220218  // Get our Packet from a gloabal map with all Packets created in the send() method of Packet.
    221219  std::map<size_t, Packet*>::iterator it = packetMap_.find((size_t)enetPacket);
Note: See TracChangeset for help on using the changeset viewer.