summaryrefslogtreecommitdiff
path: root/src/bin/elua/main.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2020-05-29 16:22:42 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2020-05-29 16:40:05 +0200
commit5197200ac1d49366f205a62a09a377fdece62ff9 (patch)
tree2ee8965984d211e0f4f38b77a11f8babb3ca49dc /src/bin/elua/main.c
parent0b5a8fc127ab282648828304fe06a2652dc3553a (diff)
elua: allow building with interpreted (non-luajit) lua
This doesn't fully work yet as e.g. Eolian bindings require the bitop module only present in luajit for now. In order to build, you will need to install https://github.com/q66/cffi-lua in order to provide the FFI. It needs to be built for the Lua version you are building EFL with.
Diffstat (limited to '')
-rw-r--r--src/bin/elua/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bin/elua/main.c b/src/bin/elua/main.c
index ed1b4074a4..0c228b68f0 100644
--- a/src/bin/elua/main.c
+++ b/src/bin/elua/main.c
@@ -138,6 +138,13 @@ elua_bin_shutdown(Elua_State *es, int c)
138 exit(c); 138 exit(c);
139} 139}
140 140
141#if LUA_VERSION_NUM < 502
142# define elua_cpcall(L, f, u) lua_cpcall(L, f, u)
143#else
144# define elua_cpcall(L, f, u) \
145 (lua_pushcfunction(L, f), lua_pushlightuserdata(L, u), lua_pcall(L, 1, 0, 0))
146#endif
147
141int 148int
142main(int argc, char **argv) 149main(int argc, char **argv)
143{ 150{
@@ -175,7 +182,7 @@ main(int argc, char **argv)
175 m.argv = argv; 182 m.argv = argv;
176 m.status = 0; 183 m.status = 0;
177 184
178 elua_bin_shutdown(es, !!(lua_cpcall(elua_state_lua_state_get(es), elua_main, &m) || m.status)); 185 elua_bin_shutdown(es, !!(elua_cpcall(elua_state_lua_state_get(es), elua_main, &m) || m.status));
179 186
180 return 0; /* never gets here */ 187 return 0; /* never gets here */
181} 188}