[Orxonox-commit 102] r2797 - in trunk/src: . orxonox/gamestates orxonox/pch/havepch

landauf at orxonox.net landauf at orxonox.net
Tue Mar 17 22:53:54 CET 2009


Author: landauf
Date: 2009-03-17 21:53:53 +0000 (Tue, 17 Mar 2009)
New Revision: 2797

Modified:
   trunk/src/OrxonoxConfig.h.in
   trunk/src/orxonox/gamestates/GSGraphics.h
   trunk/src/orxonox/gamestates/GSRoot.cc
   trunk/src/orxonox/pch/havepch/OrxonoxStableHeaders.h
Log:
Added some #ifndef's around #define NOMINMAX and #define FORCEINLINE to avoid "symbol redefined" compiler-warnings.

Reto, I hope this doesn't cause any troubles. If it does, I suggest using "#undef symbolname" instead of "#ifndef symbolname". This should then work basically as before, but without warnings.


Modified: trunk/src/OrxonoxConfig.h.in
===================================================================
--- trunk/src/OrxonoxConfig.h.in	2009-03-17 12:29:18 UTC (rev 2796)
+++ trunk/src/OrxonoxConfig.h.in	2009-03-17 21:53:53 UTC (rev 2797)
@@ -84,10 +84,12 @@
 
 /* See if we can use __forceinline or if we need to use __inline instead */
 #cmakedefine HAVE_FORCEINLINE
-#ifdef HAVE_FORCEINLINE
-#  define FORCEINLINE __forceinline
-#else
-#  define FORCEINLINE __inline
+#ifndef FORCEINLINE
+#  ifdef HAVE_FORCEINLINE
+#    define FORCEINLINE __forceinline
+#  else
+#    define FORCEINLINE __inline
+#  endif
 #endif
 
 /* Try to define function information */

Modified: trunk/src/orxonox/gamestates/GSGraphics.h
===================================================================
--- trunk/src/orxonox/gamestates/GSGraphics.h	2009-03-17 12:29:18 UTC (rev 2796)
+++ trunk/src/orxonox/gamestates/GSGraphics.h	2009-03-17 21:53:53 UTC (rev 2797)
@@ -31,7 +31,9 @@
 
 #include "OrxonoxPrereqs.h"
 #include <OgrePrerequisites.h>
-#define NOMINMAX // required to stop windows.h screwing up std::min definition
+#ifndef NOMINMAX
+#  define NOMINMAX // required to stop windows.h screwing up std::min definition
+#endif
 #include <OgreWindowEventUtilities.h>
 #include "core/GameState.h"
 #include "core/OrxonoxClass.h"

Modified: trunk/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- trunk/src/orxonox/gamestates/GSRoot.cc	2009-03-17 12:29:18 UTC (rev 2796)
+++ trunk/src/orxonox/gamestates/GSRoot.cc	2009-03-17 21:53:53 UTC (rev 2797)
@@ -48,7 +48,9 @@
 #  ifndef WIN32_LEAN_AND_MEAN
 #    define WIN32_LEAN_AND_MEAN
 #  endif
-#  define NOMINMAX // required to stop windows.h screwing up std::min definition
+#  ifndef NOMINMAX
+#    define NOMINMAX // required to stop windows.h screwing up std::min definition
+#  endif
 #  include "windows.h"
 #endif
 

Modified: trunk/src/orxonox/pch/havepch/OrxonoxStableHeaders.h
===================================================================
--- trunk/src/orxonox/pch/havepch/OrxonoxStableHeaders.h	2009-03-17 12:29:18 UTC (rev 2796)
+++ trunk/src/orxonox/pch/havepch/OrxonoxStableHeaders.h	2009-03-17 21:53:53 UTC (rev 2797)
@@ -44,7 +44,9 @@
 // prevent Ogre from including winsock.h that messes with winsock2.h from enet
 #  define WIN32_LEAN_AND_MEAN
 #endif
-#define NOMINMAX // required to stop windows.h screwing up std::min definition
+#ifndef NOMINMAX
+#  define NOMINMAX // required to stop windows.h screwing up std::min definition
+#endif
 #include <Ogre.h>
 #include <CEGUI.h>
 #include <boost/thread/recursive_mutex.hpp>




More information about the Orxonox-commit mailing list