@@ -54,6 +54,12 @@ typedef int (*lua_Continuation)(lua_State* L, int status);
54
54
55
55
typedef void * (* lua_Alloc )(void * ud , void * ptr , size_t osize , size_t nsize );
56
56
57
+ /*
58
+ ** prototype for userdata destructor
59
+ */
60
+
61
+ typedef void (* lua_Destructor )(lua_State * L , void * userdata );
62
+
57
63
// non-return type
58
64
#define l_noret void LUA_NORETURN
59
65
@@ -191,7 +197,7 @@ LUA_API int lua_pushthread(lua_State* L);
191
197
LUA_API void lua_pushlightuserdatatagged (lua_State * L , void * p , int tag );
192
198
LUA_API void * lua_newuserdatatagged (lua_State * L , size_t sz , int tag );
193
199
LUA_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 );
195
201
196
202
LUA_API void * lua_newbuffer (lua_State * L , size_t sz );
197
203
@@ -321,8 +327,6 @@ LUA_API double lua_clock();
321
327
322
328
LUA_API void lua_setuserdatatag (lua_State * L , int idx , int tag );
323
329
324
- typedef void (* lua_Destructor )(lua_State * L , void * userdata );
325
-
326
330
LUA_API void lua_setuserdatadtor (lua_State * L , int tag , lua_Destructor dtor );
327
331
LUA_API lua_Destructor lua_getuserdatadtor (lua_State * L , int tag );
328
332
0 commit comments