make love lua 5.4 conform

This commit is contained in:
niki
2020-08-14 19:27:42 +02:00
parent 5f4d2f3323
commit 99e1c0034d
5 changed files with 19 additions and 6 deletions
+3 -1
View File
@@ -73,7 +73,9 @@
typedef size_t lua_Unsigned;
#endif
#if LUA_VERSION_NUM == 501
#if LUA_VERSION_NUM >= 504
# define LUAL_BUFFER53_BUFFER(B) (B)->b.b
#elif LUA_VERSION_NUM == 501
# define LUAL_BUFFER53_BUFFER(B) (B)->b.buffer
#else
# define LUAL_BUFFER53_BUFFER(B) (B)->b.initb
+5 -1
View File
@@ -309,8 +309,12 @@ int luaopen_luautf8 (lua_State *L) {
lua_setfield(L, -2, l->name);
}
}
#if LUA_VERSION_NUM >= 504
lua_pushlstring(L, UTF8PATT, sizeof(UTF8PATT) / sizeof(char) - 1);
lua_setfield(L, -2, "charpattern");
#else
lua_pushliteral(L, UTF8PATT);
lua_setfield(L, -2, "charpattern");
#endif
return 1;
}