mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
luaa: split tostring creation
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
a1480ef7d8
commit
74e4200176
1 changed files with 9 additions and 0 deletions
9
luaa.h
9
luaa.h
|
@ -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) \
|
||||
|
|
Loading…
Reference in a new issue