Support Lua 5.5 (#180)

This commit is contained in:
Kim Alvefur
2025-12-28 19:43:56 +01:00
committed by GitHub
parent 0951178220
commit 31dcb88b12

View File

@@ -311,7 +311,7 @@ static FILE *check_file(lua_State * L, int idx, const char *funcname)
return 0; return 0;
} else } else
return *fh; return *fh;
#elif LUA_VERSION_NUM >= 502 && LUA_VERSION_NUM <= 504 #elif LUA_VERSION_NUM >= 502 && LUA_VERSION_NUM <= 505
luaL_Stream *fh = (luaL_Stream *) luaL_checkudata(L, idx, "FILE*"); luaL_Stream *fh = (luaL_Stream *) luaL_checkudata(L, idx, "FILE*");
if (fh->closef == 0 || fh->f == NULL) { if (fh->closef == 0 || fh->f == NULL) {
luaL_error(L, "%s: closed file", funcname); luaL_error(L, "%s: closed file", funcname);