@@ -111,25 +111,27 @@ static luaV_Dict *luaV_pushdict (lua_State *L, dict_T *dic);
111111#define lua_tointeger dll_lua_tointeger
112112#define lua_call dll_lua_call
113113#define lua_pcall dll_lua_pcall
114-
115- #elif LUA_VERSION_NUM <= 502
116- #define lua_replace dll_lua_replace
117- #define lua_remove dll_lua_remove
118114#else
119- #define lua_rotate dll_lua_rotate
120115#define lua_tonumberx dll_lua_tonumberx
121116#define lua_tointegerx dll_lua_tointegerx
122117#define lua_callk dll_lua_callk
123118#define lua_pcallk dll_lua_pcallk
124119#define lua_getglobal dll_lua_getglobal
125120#define lua_setglobal dll_lua_setglobal
126121#endif
122+ #if LUA_VERSION_NUM <= 502
123+ #define lua_replace dll_lua_replace
124+ #define lua_remove dll_lua_remove
125+ #endif
126+ #if LUA_VERSION_NUM >= 503
127+ #define lua_rotate dll_lua_rotate
128+ #define lua_copy dll_lua_copy
129+ #endif
127130#define lua_typename dll_lua_typename
128131#define lua_close dll_lua_close
129132#define lua_gettop dll_lua_gettop
130133#define lua_settop dll_lua_settop
131134#define lua_pushvalue dll_lua_pushvalue
132- #define lua_copy dll_lua_copy
133135#define lua_isnumber dll_lua_isnumber
134136#define lua_isstring dll_lua_isstring
135137#define lua_type dll_lua_type
@@ -199,12 +201,7 @@ lua_Number (*dll_lua_tonumber) (lua_State *L, int idx);
199201lua_Integer (* dll_lua_tointeger ) (lua_State * L , int idx );
200202void (* dll_lua_call ) (lua_State * L , int nargs , int nresults );
201203int (* dll_lua_pcall ) (lua_State * L , int nargs , int nresults , int errfunc );
202- #elif LUA_VERSION_NUM <= 502
203- void (* dll_lua_replace ) (lua_State * L , int idx );
204- void (* dll_lua_remove ) (lua_State * L , int idx );
205204#else
206-
207- void (* dll_lua_rotate ) (lua_State * L , int idx , int n );
208205lua_Number (* dll_lua_tonumberx ) (lua_State * L , int idx , int * isnum );
209206lua_Integer (* dll_lua_tointegerx ) (lua_State * L , int idx , int * isnum );
210207void (* dll_lua_callk ) (lua_State * L , int nargs , int nresults , int ctx ,
@@ -213,6 +210,13 @@ int (*dll_lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
213210 int ctx , lua_CFunction k );
214211void (* dll_lua_getglobal ) (lua_State * L , const char * var );
215212void (* dll_lua_setglobal ) (lua_State * L , const char * var );
213+ #endif
214+ #if LUA_VERSION_NUM <= 502
215+ void (* dll_lua_replace ) (lua_State * L , int idx );
216+ void (* dll_lua_remove ) (lua_State * L , int idx );
217+ #endif
218+ #if LUA_VERSION_NUM >= 503
219+ void (* dll_lua_rotate ) (lua_State * L , int idx , int n );
216220void (* dll_lua_copy ) (lua_State * L , int fromidx , int toidx );
217221#endif
218222const char * (* dll_lua_typename ) (lua_State * L , int tp );
@@ -296,18 +300,21 @@ static const luaV_Reg luaV_dll[] = {
296300 {"lua_tointeger" , (luaV_function ) & dll_lua_tointeger },
297301 {"lua_call" , (luaV_function ) & dll_lua_call },
298302 {"lua_pcall" , (luaV_function ) & dll_lua_pcall },
299- #elif LUA_VERSION_NUM <= 502
300- {"lua_replace" , (luaV_function ) & dll_lua_replace },
301- {"lua_remove" , (luaV_function ) & dll_lua_remove },
302303#else
303- {"lua_rotate" , (luaV_function ) & dll_lua_rotate },
304- {"lua_copy" , (luaV_function ) & dll_lua_copy },
305304 {"lua_tonumberx" , (luaV_function ) & dll_lua_tonumberx },
306305 {"lua_tointegerx" , (luaV_function ) & dll_lua_tointegerx },
307306 {"lua_callk" , (luaV_function ) & dll_lua_callk },
308307 {"lua_pcallk" , (luaV_function ) & dll_lua_pcallk },
309308 {"lua_getglobal" , (luaV_function ) & dll_lua_getglobal },
310309 {"lua_setglobal" , (luaV_function ) & dll_lua_setglobal },
310+ #endif
311+ #if LUA_VERSION_NUM <= 502
312+ {"lua_replace" , (luaV_function ) & dll_lua_replace },
313+ {"lua_remove" , (luaV_function ) & dll_lua_remove },
314+ #endif
315+ #if LUA_VERSION_NUM >= 503
316+ {"lua_rotate" , (luaV_function ) & dll_lua_rotate },
317+ {"lua_copy" , (luaV_function ) & dll_lua_copy },
311318#endif
312319 {"lua_typename" , (luaV_function ) & dll_lua_typename },
313320 {"lua_close" , (luaV_function ) & dll_lua_close },
0 commit comments