From 68e0b809a625a941aeac429684d016f1afd2ac04 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 29 May 2005 02:13:33 +0000 Subject: [PATCH] LuaFunction -> RegisterLuaFunction LuaFunction_NoArgs -> LuaFunction remove RageUtil.h --- stepmania/src/LuaFunctions.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/stepmania/src/LuaFunctions.h b/stepmania/src/LuaFunctions.h index ba20ec9354..7b013fb894 100644 --- a/stepmania/src/LuaFunctions.h +++ b/stepmania/src/LuaFunctions.h @@ -2,7 +2,6 @@ #define LUA_FUNCTIONS_H #include "LuaBinding.h" -#include "RageUtil.h" /* for ssprintf */ extern "C" { @@ -14,33 +13,33 @@ extern "C" #define LUA_RETURN( expr, L ) { LuaHelpers::Push( expr, L ); return 1; } /* Helpers to create common functions: */ -/* Functions that take no arguments: */ -#define LuaFunction_NoArgs( func, call ) \ +#define LuaFunction( func, call ) \ int LuaFunc_##func( lua_State *L ) { \ LUA_RETURN( call, L ); \ } \ -LuaFunction( func ); /* register it */ +RegisterLuaFunction( func ); +#define LuaFunction_NoArgs LuaFunction /* compat */ #define LuaFunction_Int( func, call ) \ int LuaFunc_##func( lua_State *L ) { \ const int a1 = IArg(1); \ LUA_RETURN( call, L ); \ } \ -LuaFunction( func ); /* register it */ +RegisterLuaFunction( func ); #define LuaFunction_Float( func, call ) \ int LuaFunc_##func( lua_State *L ) { \ const float a1 = FArg(1); \ LUA_RETURN( call, L ); \ } \ -LuaFunction( func ); /* register it */ +RegisterLuaFunction( func ); #define LuaFunction_Str( func, call ) \ int LuaFunc_##func( lua_State *L ) { \ CString str = SArg(1); \ LUA_RETURN( call, L ); \ } \ -LuaFunction( func ); /* register it */ +RegisterLuaFunction( func ); /* Linked list of functions we make available to Lua. */ struct LuaFunctionList @@ -51,7 +50,7 @@ struct LuaFunctionList LuaFunctionList *next; }; extern LuaFunctionList *g_LuaFunctionList; -#define LuaFunction( func ) static LuaFunctionList g_##func( #func, LuaFunc_##func ) +#define RegisterLuaFunction( func ) static LuaFunctionList g_##func( #func, LuaFunc_##func ) #endif