Comparison

util-src/encodings.c @ 12575:1f6f05a98fcd

util-src: Remove Lua 5.1 compat macros Part of #1600
author Kim Alvefur <zash@zash.se>
date Fri, 01 Jul 2022 21:21:21 +0200
parent 10921:6eb5d2bb11af
child 12976:a187600ec7d6
comparison
equal deleted inserted replaced
12574:18d33668c5fa 12575:1f6f05a98fcd
19 #include <string.h> 19 #include <string.h>
20 #include <stdlib.h> 20 #include <stdlib.h>
21 #include "lua.h" 21 #include "lua.h"
22 #include "lauxlib.h" 22 #include "lauxlib.h"
23 23
24 #if (LUA_VERSION_NUM == 501)
25 #define luaL_setfuncs(L, R, N) luaL_register(L, NULL, R)
26 #endif
27 #if (LUA_VERSION_NUM < 504) 24 #if (LUA_VERSION_NUM < 504)
28 #define luaL_pushfail lua_pushnil 25 #define luaL_pushfail lua_pushnil
29 #endif 26 #endif
30 27
31 /***************** BASE64 *****************/ 28 /***************** BASE64 *****************/
614 }; 611 };
615 612
616 /***************** end *****************/ 613 /***************** end *****************/
617 614
618 LUALIB_API int luaopen_util_encodings(lua_State *L) { 615 LUALIB_API int luaopen_util_encodings(lua_State *L) {
619 #if (LUA_VERSION_NUM > 501)
620 luaL_checkversion(L); 616 luaL_checkversion(L);
621 #endif
622 #ifdef USE_STRINGPREP_ICU 617 #ifdef USE_STRINGPREP_ICU
623 init_icu(); 618 init_icu();
624 #endif 619 #endif
625 lua_newtable(L); 620 lua_newtable(L);
626 621