diff --git a/src/LuaManager.h b/src/LuaManager.h index 084532800a..fe5fd7e435 100644 --- a/src/LuaManager.h +++ b/src/LuaManager.h @@ -172,19 +172,19 @@ private: * Once the loop exits normally, the top of the stack will be where it was before. * If you break out of the loop early, you need to handle that explicitly. */ #define FOREACH_LUATABLE(L,index) \ -for( const int UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \ - UNIQUE_NAME(top) = (lua_pushnil(L),lua_gettop(L)); \ - lua_next(L, UNIQUE_NAME(tab)) && (lua_pushvalue(L,-2),true); \ - lua_settop(L,UNIQUE_NAME(top)) ) +for( const int SM_UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \ + SM_UNIQUE_NAME(top) = (lua_pushnil(L),lua_gettop(L)); \ + lua_next(L, SM_UNIQUE_NAME(tab)) && (lua_pushvalue(L,-2),true); \ + lua_settop(L,SM_UNIQUE_NAME(top)) ) /** @brief Iterate over the array elements of a table. */ #define FOREACH_LUATABLEI(L, index, i) \ - for( int UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \ - UNIQUE_NAME(top) = lua_gettop(L), i = 1; \ + for( int SM_UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \ + SM_UNIQUE_NAME(top) = lua_gettop(L), i = 1; \ lua_rawgeti( L, tab, i ), \ lua_isnil(L, -1)? \ (lua_pop(L, 1), false):(true); /* if nil, pop the nil and stop traversal */ \ - lua_settop(L,UNIQUE_NAME(top)), ++i ) + lua_settop(L,SM_UNIQUE_NAME(top)), ++i ) struct RegisterLuaFunction { RegisterLuaFunction( RegisterWithLuaFn pfn ) { LuaManager::Register( pfn ); } }; diff --git a/src/RageThreads.h b/src/RageThreads.h index 1fc7c7f49f..1472305481 100644 --- a/src/RageThreads.h +++ b/src/RageThreads.h @@ -146,7 +146,7 @@ private: LockMutex& operator=(const LockMutex& rhs); }; -#define LockMut(m) LockMutex UNIQUE_NAME(LocalLock) (m, __FILE__, __LINE__) +#define LockMut(m) LockMutex SM_UNIQUE_NAME(LocalLock) (m, __FILE__, __LINE__) class EventImpl; class RageEvent: public RageMutex diff --git a/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm b/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm index f733deedaa..491f133439 100644 --- a/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm +++ b/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm @@ -36,7 +36,7 @@ public: ~AutoreleasePool() { [m_Pool release]; } }; -#define POOL AutoreleasePool UNIQUE_NAME(pool) +#define POOL AutoreleasePool SM_UNIQUE_NAME(pool) // Window delegate class @interface SMWindowDelegate : NSObject diff --git a/src/global.h b/src/global.h index 1a39940763..2baf82ae2d 100644 --- a/src/global.h +++ b/src/global.h @@ -152,11 +152,11 @@ void ShowWarningOrTrace( const char *file, int line, const char *message, bool b #define DEBUG_ASSERT_M(x,y) #endif -/* Use UNIQUE_NAME to get the line number concatenated to x. This is useful for +/* Use SM_UNIQUE_NAME to get the line number concatenated to x. This is useful for * generating unique identifiers in other macros. */ -#define UNIQUE_NAME3(x,line) x##line -#define UNIQUE_NAME2(x,line) UNIQUE_NAME3(x, line) -#define UNIQUE_NAME(x) UNIQUE_NAME2(x, __LINE__) +#define SM_UNIQUE_NAME3(x,line) x##line +#define SM_UNIQUE_NAME2(x,line) UNIQUE_NAME3(x, line) +#define SM_UNIQUE_NAME(x) UNIQUE_NAME2(x, __LINE__) template struct CompileAssert; template <> struct CompileAssert { };