diff options
Diffstat (limited to 'dev-lua/luaossl/files/patches/99999999/compat52-luajit.patch')
-rw-r--r-- | dev-lua/luaossl/files/patches/99999999/compat52-luajit.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/dev-lua/luaossl/files/patches/99999999/compat52-luajit.patch b/dev-lua/luaossl/files/patches/99999999/compat52-luajit.patch new file mode 100644 index 0000000..1da7c7a --- /dev/null +++ b/dev-lua/luaossl/files/patches/99999999/compat52-luajit.patch @@ -0,0 +1,59 @@ +diff -NaurBwd a/compat52.h b/compat52.h +--- a/src/compat52.h 2017-05-10 02:07:08.039072892 +0700 ++++ b/src/compat52.h 2017-05-10 02:06:55.224543285 +0700 +@@ -32,20 +32,19 @@ + + #if LUA_VERSION_NUM < 502 + +-#define LUA_OK 0 + +- ++#ifndef LUA_OK + static void luaL_setmetatable(lua_State *L, const char *tname) { + luaL_getmetatable(L, tname); + lua_setmetatable(L, -2); + } /* luaL_setmetatable() */ +- ++#endif + + static int lua_absindex(lua_State *L, int idx) { + return (idx > 0 || idx <= LUA_REGISTRYINDEX)? idx : lua_gettop(L) + idx + 1; + } /* lua_absindex() */ +- + ++#ifndef LUA_OK + static void *luaL_testudata(lua_State *L, int arg, const char *tname) { + void *p = lua_touserdata(L, arg); + int eq; +@@ -70,8 +69,10 @@ + + return (eq)? p : 0; + } /* luaL_testudate() */ ++#endif + + ++#ifndef LUA_OK + static void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup) { + int i, t = lua_absindex(L, -1 - nup); + +@@ -84,13 +85,18 @@ + + lua_pop(L, nup); + } /* luaL_setfuncs() */ ++#endif + +- ++#ifndef LUA_OK + #define luaL_newlibtable(L, l) \ + lua_createtable(L, 0, (sizeof (l) / sizeof *(l)) - 1) ++#endif + ++#ifndef LUA_OK + #define luaL_newlib(L, l) \ + (luaL_newlibtable((L), (l)), luaL_setfuncs((L), (l), 0)) ++#endif ++#define LUA_OK 0 + + + static void luaL_requiref(lua_State *L, const char *modname, lua_CFunction openf, int glb) { + |