Mercurial > vim
comparison src/if_lua.c @ 21323:5b0bbc5d4e74 v8.2.1212
patch 8.2.1212: cannot build with Lua 5.4
Commit: https://github.com/vim/vim/commit/5551b131daef3a621a28dcbbe118920f5b9fabe6
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 14 21:54:28 2020 +0200
patch 8.2.1212: cannot build with Lua 5.4
Problem: Cannot build with Lua 5.4.
Solution: Use luaL_typeerror instead defining it. (closes https://github.com/vim/vim/issues/6454)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 14 Jul 2020 22:00:04 +0200 |
parents | 985e61894bb4 |
children | f9d87868d77f |
comparison
equal
deleted
inserted
replaced
21322:ade12c914e81 | 21323:5b0bbc5d4e74 |
---|---|
117 #define luaL_prepbuffsize dll_luaL_prepbuffsize | 117 #define luaL_prepbuffsize dll_luaL_prepbuffsize |
118 #define luaL_setfuncs dll_luaL_setfuncs | 118 #define luaL_setfuncs dll_luaL_setfuncs |
119 #define luaL_loadfilex dll_luaL_loadfilex | 119 #define luaL_loadfilex dll_luaL_loadfilex |
120 #define luaL_loadbufferx dll_luaL_loadbufferx | 120 #define luaL_loadbufferx dll_luaL_loadbufferx |
121 #define luaL_argerror dll_luaL_argerror | 121 #define luaL_argerror dll_luaL_argerror |
122 #endif | |
123 #if LUA_VERSION_NUM >= 504 | |
124 #define luaL_typeerror dll_luaL_typeerror | |
122 #endif | 125 #endif |
123 #define luaL_checkany dll_luaL_checkany | 126 #define luaL_checkany dll_luaL_checkany |
124 #define luaL_checklstring dll_luaL_checklstring | 127 #define luaL_checklstring dll_luaL_checklstring |
125 #define luaL_checkinteger dll_luaL_checkinteger | 128 #define luaL_checkinteger dll_luaL_checkinteger |
126 #define luaL_optinteger dll_luaL_optinteger | 129 #define luaL_optinteger dll_luaL_optinteger |
215 void (*dll_luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup); | 218 void (*dll_luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup); |
216 int (*dll_luaL_loadfilex) (lua_State *L, const char *filename, const char *mode); | 219 int (*dll_luaL_loadfilex) (lua_State *L, const char *filename, const char *mode); |
217 int (*dll_luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, const char *name, const char *mode); | 220 int (*dll_luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, const char *name, const char *mode); |
218 int (*dll_luaL_argerror) (lua_State *L, int numarg, const char *extramsg); | 221 int (*dll_luaL_argerror) (lua_State *L, int numarg, const char *extramsg); |
219 #endif | 222 #endif |
223 #if LUA_VERSION_NUM >= 504 | |
224 int (*dll_luaL_typeerror) (lua_State *L, int narg, const char *tname); | |
225 #endif | |
220 void (*dll_luaL_checkany) (lua_State *L, int narg); | 226 void (*dll_luaL_checkany) (lua_State *L, int narg); |
221 const char *(*dll_luaL_checklstring) (lua_State *L, int numArg, size_t *l); | 227 const char *(*dll_luaL_checklstring) (lua_State *L, int numArg, size_t *l); |
222 lua_Integer (*dll_luaL_checkinteger) (lua_State *L, int numArg); | 228 lua_Integer (*dll_luaL_checkinteger) (lua_State *L, int numArg); |
223 lua_Integer (*dll_luaL_optinteger) (lua_State *L, int nArg, lua_Integer def); | 229 lua_Integer (*dll_luaL_optinteger) (lua_State *L, int nArg, lua_Integer def); |
224 void (*dll_luaL_checktype) (lua_State *L, int narg, int t); | 230 void (*dll_luaL_checktype) (lua_State *L, int narg, int t); |
333 {"luaL_prepbuffsize", (luaV_function) &dll_luaL_prepbuffsize}, | 339 {"luaL_prepbuffsize", (luaV_function) &dll_luaL_prepbuffsize}, |
334 {"luaL_setfuncs", (luaV_function) &dll_luaL_setfuncs}, | 340 {"luaL_setfuncs", (luaV_function) &dll_luaL_setfuncs}, |
335 {"luaL_loadfilex", (luaV_function) &dll_luaL_loadfilex}, | 341 {"luaL_loadfilex", (luaV_function) &dll_luaL_loadfilex}, |
336 {"luaL_loadbufferx", (luaV_function) &dll_luaL_loadbufferx}, | 342 {"luaL_loadbufferx", (luaV_function) &dll_luaL_loadbufferx}, |
337 {"luaL_argerror", (luaV_function) &dll_luaL_argerror}, | 343 {"luaL_argerror", (luaV_function) &dll_luaL_argerror}, |
344 #endif | |
345 #if LUA_VERSION_NUM >= 504 | |
346 {"luaL_typeerror", (luaV_function) &dll_luaL_typeerror}, | |
338 #endif | 347 #endif |
339 {"luaL_checkany", (luaV_function) &dll_luaL_checkany}, | 348 {"luaL_checkany", (luaV_function) &dll_luaL_checkany}, |
340 {"luaL_checklstring", (luaV_function) &dll_luaL_checklstring}, | 349 {"luaL_checklstring", (luaV_function) &dll_luaL_checklstring}, |
341 {"luaL_checkinteger", (luaV_function) &dll_luaL_checkinteger}, | 350 {"luaL_checkinteger", (luaV_function) &dll_luaL_checkinteger}, |
342 {"luaL_optinteger", (luaV_function) &dll_luaL_optinteger}, | 351 {"luaL_optinteger", (luaV_function) &dll_luaL_optinteger}, |
455 { | 464 { |
456 return lua_link_init((char *)p_luadll, verbose) == OK; | 465 return lua_link_init((char *)p_luadll, verbose) == OK; |
457 } | 466 } |
458 #endif | 467 #endif |
459 | 468 |
460 #if LUA_VERSION_NUM > 501 | 469 #if LUA_VERSION_NUM > 501 && LUA_VERSION_NUM < 504 |
461 static int | 470 static int |
462 luaL_typeerror(lua_State *L, int narg, const char *tname) | 471 luaL_typeerror(lua_State *L, int narg, const char *tname) |
463 { | 472 { |
464 const char *msg = lua_pushfstring(L, "%s expected, got %s", | 473 const char *msg = lua_pushfstring(L, "%s expected, got %s", |
465 tname, luaL_typename(L, narg)); | 474 tname, luaL_typename(L, narg)); |