[Orxonox-commit 637] r3169 - in branches/pch/src: . core network

rgrieder at orxonox.net rgrieder at orxonox.net
Sun Jun 14 18:35:31 CEST 2009


Author: rgrieder
Date: 2009-06-14 18:35:31 +0200 (Sun, 14 Jun 2009)
New Revision: 3169

Modified:
   branches/pch/src/OrxonoxConfig.h.in
   branches/pch/src/SpecialConfig.h.in
   branches/pch/src/core/Game.h
   branches/pch/src/network/NetworkFunction.h
Log:
Replacing MACRO_CONCATENATE and MACRO_QUOTEME with the more robust boost versions.

Modified: branches/pch/src/OrxonoxConfig.h.in
===================================================================
--- branches/pch/src/OrxonoxConfig.h.in	2009-06-14 16:12:36 UTC (rev 3168)
+++ branches/pch/src/OrxonoxConfig.h.in	2009-06-14 16:35:31 UTC (rev 3169)
@@ -142,15 +142,6 @@
 
 
 /*---------------------------------
- * Special Macros
- *-------------------------------*/
-#define MACRO_CONCATENATE_AUX(a, b) a##b
-#define MACRO_CONCATENATE(a, b) MACRO_CONCATENATE_AUX(a, b)
-#define MACRO_QUOTEME_AUX(x) #x
-#define MACRO_QUOTEME(x) MACRO_QUOTEME_AUX(x)
-
-
-/*---------------------------------
  * Options
  *-------------------------------*/
 /**

Modified: branches/pch/src/SpecialConfig.h.in
===================================================================
--- branches/pch/src/SpecialConfig.h.in	2009-06-14 16:12:36 UTC (rev 3168)
+++ branches/pch/src/SpecialConfig.h.in	2009-06-14 16:35:31 UTC (rev 3169)
@@ -40,6 +40,7 @@
 #define _SpecialConfig_H__
 
 #include "OrxonoxConfig.h"
+#include <boost/preprocessor/stringize.hpp>
 
 /**
 @def CEGUILUA_USE_INTERNAL_LIBRARY
@@ -80,8 +81,8 @@
     // DEVELOPMENT RUN PATHS
     const char ORXONOX_MEDIA_DEV_PATH[]       = "@CMAKE_MEDIA_OUTPUT_DIRECTORY@";
 #ifdef CMAKE_CONFIGURATION_TYPES
-    const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" MACRO_QUOTEME(CMAKE_BUILD_TYPE);
-    const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@/"    MACRO_QUOTEME(CMAKE_BUILD_TYPE);
+    const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
+    const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@/"    BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
 #else
     const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@";
     const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@";

Modified: branches/pch/src/core/Game.h
===================================================================
--- branches/pch/src/core/Game.h	2009-06-14 16:12:36 UTC (rev 3168)
+++ branches/pch/src/core/Game.h	2009-06-14 16:35:31 UTC (rev 3169)
@@ -43,6 +43,7 @@
 #include <string>
 #include <vector>
 #include <boost/shared_ptr.hpp>
+#include <boost/preprocessor/cat.hpp>
 
 #include "OrxonoxClass.h"
 
@@ -52,7 +53,7 @@
     and every following paramter is a constructor argument (which is usually non existent)
 */
 #define AddGameState(classname, ...) \
-    static bool MACRO_CONCATENATE(bGameStateDummy_##classname, __LINE__) = orxonox::Game::addGameState(new classname(__VA_ARGS__))
+    static bool BOOST_PP_CAT(bGameStateDummy_##classname, __LINE__) = orxonox::Game::addGameState(new classname(__VA_ARGS__))
 
 // tolua_begin
 namespace orxonox

Modified: branches/pch/src/network/NetworkFunction.h
===================================================================
--- branches/pch/src/network/NetworkFunction.h	2009-06-14 16:12:36 UTC (rev 3168)
+++ branches/pch/src/network/NetworkFunction.h	2009-06-14 16:35:31 UTC (rev 3169)
@@ -35,6 +35,7 @@
 #include <string>
 #include <map>
 #include <cassert>
+#include <boost/preprocessor/cat.hpp>
 #include "util/MultiType.h"
 #include "core/Functor.h"
 #include "synchronisable/Synchronisable.h"
@@ -214,9 +215,9 @@
 }
 
 #define registerStaticNetworkFunction( functionPointer ) \
-  static void* MACRO_CONCATENATE( NETWORK_FUNCTION_, __LINE__ ) = registerStaticNetworkFunctionFct( functionPointer, #functionPointer );
+  static void* BOOST_PP_CAT( NETWORK_FUNCTION_, __LINE__ ) = registerStaticNetworkFunctionFct( functionPointer, #functionPointer );
 #define registerMemberNetworkFunction( class, function ) \
-  static void* MACRO_CONCATENATE( NETWORK_FUNCTION_##class, __LINE__ ) = registerMemberNetworkFunctionFct<class>( &class::function, #class "_" #function);
+  static void* BOOST_PP_CAT( NETWORK_FUNCTION_##class, __LINE__ ) = registerMemberNetworkFunctionFct<class>( &class::function, #class "_" #function);
   // call it with functionPointer, clientID, args
 #define callStaticNetworkFunction( functionPointer, ...) \
   { \




More information about the Orxonox-commit mailing list