luaa: split tostring creation

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-04-09 11:34:38 +02:00
parent a1480ef7d8
commit 74e4200176
1 changed files with 9 additions and 0 deletions

9
luaa.h
View File

@ -39,6 +39,15 @@
luaA_warn(L, "%s: This function is deprecated and will be removed, see %s", \
__FUNCTION__, repl)
#define DO_LUA_TOSTRING(type, prefix, lua_type) \
static int \
luaA_##prefix##_tostring(lua_State *L) \
{ \
type *p = luaL_checkudata(L, 1, lua_type); \
lua_pushfstring(L, lua_type ": %p", p); \
return 1; \
}
#define DO_LUA_NEW(decl, type, prefix, lua_type, type_ref) \
decl int \
luaA_##prefix##_userdata_new(lua_State *L, type *p) \