Support Lua 5.4

This commit is contained in:
Peter Melnichenko
2018-03-15 22:10:09 +03:00
committed by Hisham Muhammad
parent 04bdaf9a1e
commit 04ba8d686a

View File

@@ -77,7 +77,7 @@
#define LFS_VERSION "1.7.0" #define LFS_VERSION "1.7.0"
#define LFS_LIBNAME "lfs" #define LFS_LIBNAME "lfs"
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */ #if LUA_VERSION_NUM >= 503 /* Lua 5.3+ */
#ifndef luaL_optlong #ifndef luaL_optlong
#define luaL_optlong luaL_optinteger #define luaL_optlong luaL_optinteger
@@ -226,7 +226,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 <= 503 #elif LUA_VERSION_NUM >= 502 && LUA_VERSION_NUM <= 504
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);