luaa: split tostring creation
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
a1480ef7d8
commit
74e4200176
9
luaa.h
9
luaa.h
|
@ -39,6 +39,15 @@
|
||||||
luaA_warn(L, "%s: This function is deprecated and will be removed, see %s", \
|
luaA_warn(L, "%s: This function is deprecated and will be removed, see %s", \
|
||||||
__FUNCTION__, repl)
|
__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) \
|
#define DO_LUA_NEW(decl, type, prefix, lua_type, type_ref) \
|
||||||
decl int \
|
decl int \
|
||||||
luaA_##prefix##_userdata_new(lua_State *L, type *p) \
|
luaA_##prefix##_userdata_new(lua_State *L, type *p) \
|
||||||
|
|
Loading…
Reference in New Issue