UNIQUE_NAME -> SM_UNIQUE_NAME (avoid conflict with MinGW headers)

This commit is contained in:
Ben "root" Anderson
2013-10-24 19:27:23 -05:00
parent 810283f2a2
commit b3c76a3814
4 changed files with 13 additions and 13 deletions
+7 -7
View File
@@ -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 ); } };
+1 -1
View File
@@ -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
@@ -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
+4 -4
View File
@@ -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 <bool> struct CompileAssert;
template <> struct CompileAssert<true> { };