Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2946 for code/trunk


Ignore:
Timestamp:
May 1, 2009, 10:20:02 PM (16 years ago)
Author:
rgrieder
Message:

Fixed a bug when using the LINE macro in Game.h
If you want to concatenate LINE to form a variable name, use:
MACRO_CONCATENATE(dummyvar##myParam1, LINE)

Location:
code/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/OrxonoxConfig.h.in

    r2797 r2946  
    142142
    143143/*---------------------------------
     144 * Special Macros
     145 *-------------------------------*/
     146#define MACRO_CONCATENATE_AUX(a, b) a##b
     147#define MACRO_CONCATENATE(a, b) MACRO_CONCATENATE_AUX(a, b)
     148#define MACRO_QUOTEME_AUX(x) #x
     149#define MACRO_QUOTEME(x) MACRO_QUOTEME_AUX(x)
     150
     151
     152/*---------------------------------
    144153 * Includes
    145154 *-------------------------------*/
  • code/trunk/src/SpecialConfig.h.in

    r2710 r2946  
    4040#define _SpecialConfig_H__
    4141
     42#include "OrxonoxConfig.h"
     43
    4244/* Set whether we must suffix "ceguilua/" for the CEGUILua.h include */
    4345#cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY
     
    5355/* Using MSVC or XCode IDE */
    5456#cmakedefine CMAKE_CONFIGURATION_TYPES
    55 
    56 /* Macros used in the next section */
    57 #define MACRO_CONCATENATE(str1, str2) str1##str2
    58 #define MACRO_QUOTEME_AUX(x) #x
    59 #define MACRO_QUOTEME(x) MACRO_QUOTEME_AUX(x)
    6057
    6158/* Handle default ConfigValues */
  • code/trunk/src/core/Game.h

    r2927 r2946  
    4444
    4545#define AddGameState(classname, name) \
    46     static bool bGameStateDummy_##classname##__LINE__ = orxonox::Game::addGameState(new classname(name))
     46    static bool MACRO_CONCATENATE(bGameStateDummy_##classname, __LINE__) = orxonox::Game::addGameState(new classname(name))
    4747
    4848namespace orxonox
Note: See TracChangeset for help on using the changeset viewer.