Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2756


Ignore:
Timestamp:
Mar 8, 2009, 1:24:15 PM (15 years ago)
Author:
rgrieder
Message:

Minimising problems when including windows.h because it defines macros like "min" and "max" if not explicitly specified.
There are two headers we use that include windows.h: OgreWindowEventUtilities.h and enet.h. I had to tweak a little bit there as well.

Location:
code/trunk/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/network/ClientConnection.h

    r2171 r2756  
    4444
    4545#include <string>
     46#ifndef WIN32_LEAN_AND_MEAN
     47#  define WIN32_LEAN_AND_MEAN
     48#endif
     49#define NOMINMAX // required to stop windows.h screwing up std::min definition
    4650#include <enet/enet.h>
    4751#include <boost/thread/recursive_mutex.hpp>
  • code/trunk/src/network/ClientInformation.h

    r2662 r2756  
    4343#include "NetworkPrereqs.h"
    4444
     45#ifndef WIN32_LEAN_AND_MEAN
     46#  define WIN32_LEAN_AND_MEAN
     47#endif
     48#define NOMINMAX // required to stop windows.h screwing up std::min definition
    4549#include <enet/enet.h>
    4650#include <boost/thread/recursive_mutex.hpp>
  • code/trunk/src/network/ConnectionManager.h

    r2171 r2756  
    4646#include <map>
    4747// enet library for networking support
     48#ifndef WIN32_LEAN_AND_MEAN
     49#  define WIN32_LEAN_AND_MEAN
     50#endif
     51#define NOMINMAX // required to stop windows.h screwing up std::min definition
    4852#include <enet/enet.h>
    4953#include <boost/thread/recursive_mutex.hpp>
  • code/trunk/src/network/PacketBuffer.h

    r2171 r2756  
    4444#include "NetworkPrereqs.h"
    4545
     46#ifndef WIN32_LEAN_AND_MEAN
     47#  define WIN32_LEAN_AND_MEAN
     48#endif
     49#define NOMINMAX // required to stop windows.h screwing up std::min definition
    4650#include <enet/enet.h>
    4751#include <boost/thread/recursive_mutex.hpp>
  • code/trunk/src/network/packet/DeleteObjects.cc

    r2662 r2756  
    2929
    3030#include "DeleteObjects.h"
     31#ifndef WIN32_LEAN_AND_MEAN
     32#  define WIN32_LEAN_AND_MEAN
     33#endif
     34#define NOMINMAX // required to stop windows.h screwing up std::min definition
    3135#include <enet/enet.h>
    3236#include "network/synchronisable/Synchronisable.h"
  • code/trunk/src/network/packet/Packet.cc

    r2710 r2756  
    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
    3337#include <enet/enet.h>
    3438#include <boost/bind.hpp>
  • code/trunk/src/network/packet/Packet.h

    r2710 r2756  
    3232
    3333#include <map>
     34#ifndef WIN32_LEAN_AND_MEAN
     35#  define WIN32_LEAN_AND_MEAN
     36#endif
     37#define NOMINMAX // required to stop windows.h screwing up std::min definition
    3438#include <enet/enet.h>
    3539#include <boost/thread/recursive_mutex.hpp>
  • code/trunk/src/orxonox/gamestates/GSGraphics.h

    r2710 r2756  
    3232#include "OrxonoxPrereqs.h"
    3333#include <OgrePrerequisites.h>
     34#define NOMINMAX // required to stop windows.h screwing up std::min definition
    3435#include <OgreWindowEventUtilities.h>
    3536#include "core/GameState.h"
  • code/trunk/src/orxonox/gamestates/GSRoot.cc

    r2710 r2756  
    4949#    define WIN32_LEAN_AND_MEAN
    5050#  endif
     51#  define NOMINMAX // required to stop windows.h screwing up std::min definition
    5152#  include "windows.h"
    52 
    53    //Get around Windows hackery
    54 #  ifdef max
    55 #    undef max
    56 #  endif
    57 #  ifdef min
    58 #    undef min
    59 #  endif
    6053#endif
    6154
  • code/trunk/src/orxonox/pch/havepch/OrxonoxStableHeaders.h

    r2710 r2756  
    4545#  define WIN32_LEAN_AND_MEAN
    4646#endif
     47#define NOMINMAX // required to stop windows.h screwing up std::min definition
    4748#include <Ogre.h>
    4849#include <CEGUI.h>
     
    5758#include <tinyxml/ticpp.h>
    5859#include <tolua++.h>
    59 
    60 //Get around Windows hackery (windows.h is included by Ogre.h)
    61 #ifdef ORXONOX_PLATFORM_WINDOWS
    62 #  ifdef max
    63 #    undef max
    64 #  endif
    65 #  ifdef min
    66 #    undef min
    67 #  endif
    68 #endif
    6960
    7061//----------- Our files ----------
  • code/trunk/src/util/Math.h

    r2710 r2756  
    5151#include <OgreColourValue.h>
    5252
    53 //Get around Windows hackery
    54 #ifdef ORXONOX_PLATFORM_WINDOWS
    55 #  ifdef max
    56 #    undef max
    57 #  endif
    58 #  ifdef min
    59 #    undef min
    60 #  endif
     53// Certain headers might define min and max macros
     54#if defined(max) || defined(min) || defined(sgn) || defined(clamp) || defined(square) || defined(mod)
     55#  error An inline math function was overridden by a macro
    6156#endif
    6257
Note: See TracChangeset for help on using the changeset viewer.