From 0acebabd01a862429e125d03fe902cd9bd253c92 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sat, 30 Sep 2006 04:03:42 +0000 Subject: [PATCH] We're instantiating the class, not the class members. --- stepmania/src/EnumHelper.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 ); } }