@@ -54,6 +54,12 @@ typedef int (*lua_Continuation)(lua_State* L, int status);
5454
5555typedef void * (* lua_Alloc )(void * ud , void * ptr , size_t osize , size_t nsize );
5656
57+ /*
58+ ** prototype for userdata destructor
59+ */
60+
61+ typedef void (* lua_Destructor )(lua_State * L , void * userdata );
62+
5763// non-return type
5864#define l_noret void LUA_NORETURN
5965
@@ -191,7 +197,7 @@ LUA_API int lua_pushthread(lua_State* L);
191197LUA_API void lua_pushlightuserdatatagged (lua_State * L , void * p , int tag );
192198LUA_API void * lua_newuserdatatagged (lua_State * L , size_t sz , int tag );
193199LUA_API void * lua_newuserdatataggedwithmetatable (lua_State * L , size_t sz , int tag ); // metatable fetched with lua_getuserdatametatable
194- LUA_API void * lua_newuserdatadtor (lua_State * L , size_t sz , void ( * dtor )( void * ) );
200+ LUA_API void * lua_newuserdatadtor (lua_State * L , size_t sz , lua_Destructor dtor );
195201
196202LUA_API void * lua_newbuffer (lua_State * L , size_t sz );
197203
@@ -321,8 +327,6 @@ LUA_API double lua_clock();
321327
322328LUA_API void lua_setuserdatatag (lua_State * L , int idx , int tag );
323329
324- typedef void (* lua_Destructor )(lua_State * L , void * userdata );
325-
326330LUA_API void lua_setuserdatadtor (lua_State * L , int tag , lua_Destructor dtor );
327331LUA_API lua_Destructor lua_getuserdatadtor (lua_State * L , int tag );
328332
0 commit comments