21 lines
481 B
Diff
21 lines
481 B
Diff
|
retro compatible with Lua 5.1 C/API
|
||
|
|
||
|
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
|
||
|
|
||
|
Index: b/lbase64.c
|
||
|
===================================================================
|
||
|
--- a/lbase64.c
|
||
|
+++ b/lbase64.c
|
||
|
@@ -111,7 +111,11 @@
|
||
|
|
||
|
LUALIB_API int luaopen_base64(lua_State *L)
|
||
|
{
|
||
|
+#if LUA_VERSION_NUM >= 502
|
||
|
luaL_newlib(L,R);
|
||
|
+#else
|
||
|
+ luaL_register(L,MYNAME,R);
|
||
|
+#endif
|
||
|
lua_pushliteral(L,"version"); /** version */
|
||
|
lua_pushliteral(L,MYVERSION);
|
||
|
lua_settable(L,-3);
|