diff --git a/stepmania/src/EnumHelper.h b/stepmania/src/EnumHelper.h index 5420a6cb07..5edd5d4ea8 100644 --- a/stepmania/src/EnumHelper.h +++ b/stepmania/src/EnumHelper.h @@ -129,6 +129,7 @@ namespace LuaHelpers { bool FromStack( lua_State *L, X &Object, int iOffset ); } namespace LuaHelpers { void Push( lua_State *L, const X &Object ); } #define LuaXType(X) \ +template class EnumTraits; \ static void Lua##X(lua_State* L) \ { \ /* Create the EnumToString table: { "UnlockEntry_ArcadePoints", "UnlockEntry_DancePoints" } */ \ @@ -156,10 +157,10 @@ static void Lua##X(lua_State* L) \ lua_setglobal( L, #X "Index" ); \ } \ REGISTER_WITH_LUA_FUNCTION( Lua##X ); \ -template<> LuaReference EnumTraits::StringToEnum; \ -template<> LuaReference EnumTraits::EnumToString; \ -template<> X EnumTraits::Invalid = enum_add2( NUM_##X, 1 ); \ -template<> const char *EnumTraits::szName = #X; \ +LuaReference EnumTraits::StringToEnum; \ +LuaReference EnumTraits::EnumToString; \ +X EnumTraits::Invalid = enum_add2( NUM_##X, 1 ); \ +const char *EnumTraits::szName = #X; \ namespace LuaHelpers { bool FromStack( lua_State *L, X &Object, int iOffset ) { Object = Enum::Check( L, iOffset ); return true; } } \ namespace LuaHelpers { void Push( lua_State *L, const X &Object ) { Enum::Push( L, Object ); } }