UNIQUE_NAME -> SM_UNIQUE_NAME (avoid conflict with MinGW headers)
This commit is contained in:
+7
-7
@@ -172,19 +172,19 @@ private:
|
|||||||
* Once the loop exits normally, the top of the stack will be where it was before.
|
* 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. */
|
* If you break out of the loop early, you need to handle that explicitly. */
|
||||||
#define FOREACH_LUATABLE(L,index) \
|
#define FOREACH_LUATABLE(L,index) \
|
||||||
for( const int UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \
|
for( const int SM_UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \
|
||||||
UNIQUE_NAME(top) = (lua_pushnil(L),lua_gettop(L)); \
|
SM_UNIQUE_NAME(top) = (lua_pushnil(L),lua_gettop(L)); \
|
||||||
lua_next(L, UNIQUE_NAME(tab)) && (lua_pushvalue(L,-2),true); \
|
lua_next(L, SM_UNIQUE_NAME(tab)) && (lua_pushvalue(L,-2),true); \
|
||||||
lua_settop(L,UNIQUE_NAME(top)) )
|
lua_settop(L,SM_UNIQUE_NAME(top)) )
|
||||||
|
|
||||||
/** @brief Iterate over the array elements of a table. */
|
/** @brief Iterate over the array elements of a table. */
|
||||||
#define FOREACH_LUATABLEI(L, index, i) \
|
#define FOREACH_LUATABLEI(L, index, i) \
|
||||||
for( int UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \
|
for( int SM_UNIQUE_NAME(tab) = LuaHelpers::AbsIndex(L,index), \
|
||||||
UNIQUE_NAME(top) = lua_gettop(L), i = 1; \
|
SM_UNIQUE_NAME(top) = lua_gettop(L), i = 1; \
|
||||||
lua_rawgeti( L, tab, i ), \
|
lua_rawgeti( L, tab, i ), \
|
||||||
lua_isnil(L, -1)? \
|
lua_isnil(L, -1)? \
|
||||||
(lua_pop(L, 1), false):(true); /* if nil, pop the nil and stop traversal */ \
|
(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 ); } };
|
struct RegisterLuaFunction { RegisterLuaFunction( RegisterWithLuaFn pfn ) { LuaManager::Register( pfn ); } };
|
||||||
|
|||||||
+1
-1
@@ -146,7 +146,7 @@ private:
|
|||||||
LockMutex& operator=(const LockMutex& rhs);
|
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 EventImpl;
|
||||||
class RageEvent: public RageMutex
|
class RageEvent: public RageMutex
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
~AutoreleasePool() { [m_Pool release]; }
|
~AutoreleasePool() { [m_Pool release]; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define POOL AutoreleasePool UNIQUE_NAME(pool)
|
#define POOL AutoreleasePool SM_UNIQUE_NAME(pool)
|
||||||
|
|
||||||
// Window delegate class
|
// Window delegate class
|
||||||
@interface SMWindowDelegate : NSObject
|
@interface SMWindowDelegate : NSObject
|
||||||
|
|||||||
+4
-4
@@ -152,11 +152,11 @@ void ShowWarningOrTrace( const char *file, int line, const char *message, bool b
|
|||||||
#define DEBUG_ASSERT_M(x,y)
|
#define DEBUG_ASSERT_M(x,y)
|
||||||
#endif
|
#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. */
|
* generating unique identifiers in other macros. */
|
||||||
#define UNIQUE_NAME3(x,line) x##line
|
#define SM_UNIQUE_NAME3(x,line) x##line
|
||||||
#define UNIQUE_NAME2(x,line) UNIQUE_NAME3(x, line)
|
#define SM_UNIQUE_NAME2(x,line) UNIQUE_NAME3(x, line)
|
||||||
#define UNIQUE_NAME(x) UNIQUE_NAME2(x, __LINE__)
|
#define SM_UNIQUE_NAME(x) UNIQUE_NAME2(x, __LINE__)
|
||||||
|
|
||||||
template <bool> struct CompileAssert;
|
template <bool> struct CompileAssert;
|
||||||
template <> struct CompileAssert<true> { };
|
template <> struct CompileAssert<true> { };
|
||||||
|
|||||||
Reference in New Issue
Block a user