From 6dce869a17baae6002c3cec04e975c0730461a00 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 29 May 2020 17:45:34 +0200 Subject: elua: fix build with luajit or lua 5.1 --- src/lib/elua/elua_private.h | 4 ++-- src/lib/elua/io.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/elua/elua_private.h b/src/lib/elua/elua_private.h index 02e99a481b..445bacc93d 100644 --- a/src/lib/elua/elua_private.h +++ b/src/lib/elua/elua_private.h @@ -53,12 +53,12 @@ Eina_Bool _elua_state_io_setup(const Elua_State *es); #if LUA_VERSION_NUM < 502 #define elua_register(L, lib) luaL_register(L, NULL, 0) -#define elua_rawlen(L, i) lua_rawlen(L, i) +#define elua_strlen(L, i) lua_strlen(L, i) #else #define elua_register(L, lib) luaL_setfuncs(L, lib, 0) -#define elua_rawlen(L, i) lua_rawlen(L, i) +#define elua_strlen(L, i) lua_rawlen(L, i) #endif diff --git a/src/lib/elua/io.c b/src/lib/elua/io.c index 15c0c44924..0bf978d6c6 100644 --- a/src/lib/elua/io.c +++ b/src/lib/elua/io.c @@ -167,7 +167,7 @@ read_line(lua_State *L, FILE *f) if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { luaL_pushresult(&b); - return (elua_rawlen(L, -1) > 0); + return (elua_strlen(L, -1) > 0); } l = strlen(p); if (!l || p[l - 1] != '\n') @@ -198,7 +198,7 @@ read_chars(lua_State *L, FILE *f, size_t n) n -= nr; } while (n > 0 && nr == rlen); luaL_pushresult(&b); - return (n == 0 || elua_rawlen(L, -1) > 0); + return (n == 0 || elua_strlen(L, -1) > 0); } static int -- cgit v1.2.1