Some improvements and fixes for raylua.dll/raylua.so.
This commit is contained in:
parent
60c982e77b
commit
44a4b94d97
2
makefile
2
makefile
@ -49,7 +49,7 @@ libraylua.a: src/raylua.o
|
||||
$(AR) rcu $@ $^
|
||||
|
||||
raylua.dll: src/raylua.o
|
||||
$(CC) -shared -fPIE -o $@ $^ $(LDFLAGS)
|
||||
$(CC) -shared -fPIE -o $@ $^ $(LDFLAGS) -llua5.1
|
||||
|
||||
raylua.so: src/raylua.o
|
||||
$(CC) -shared -fPIE -o $@ $^ $(LDFLAGS)
|
||||
|
@ -24,7 +24,7 @@ end
|
||||
local ffi = require "ffi"
|
||||
local C = ffi.C
|
||||
|
||||
rl = {}
|
||||
local rl = {}
|
||||
setmetatable(rl, rl)
|
||||
|
||||
-- structs definition
|
||||
@ -894,3 +894,5 @@ end
|
||||
rl.__newindex = function ()
|
||||
error "rl table is readonly"
|
||||
end
|
||||
|
||||
_G.rl = rl
|
||||
|
@ -39,7 +39,8 @@
|
||||
|
||||
extern const char *raylua_boot_str;
|
||||
|
||||
void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles, bool repl)
|
||||
void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles,
|
||||
bool repl)
|
||||
{
|
||||
lua_newtable(L);
|
||||
|
||||
@ -72,5 +73,8 @@ void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles,
|
||||
int luaopen_raylua(lua_State *L)
|
||||
{
|
||||
raylua_boot(L, NULL, NULL, false);
|
||||
return 0;
|
||||
|
||||
lua_getglobal(L, "rl");
|
||||
lua_getglobal(L, "raylua");
|
||||
return 2;
|
||||
}
|
||||
|
@ -20,7 +20,8 @@
|
||||
#include <stdbool.h>
|
||||
#include <lua.h>
|
||||
|
||||
void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles, bool repl);
|
||||
void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles,
|
||||
bool repl);
|
||||
|
||||
/* raylua_boot alias to allow direct loading */
|
||||
int luaopen_raylua(lua_State *L);
|
||||
|
@ -73,7 +73,7 @@ if raylua.loadfile then
|
||||
end
|
||||
end
|
||||
|
||||
if arg[1] then
|
||||
if arg and arg[1] then
|
||||
dofile(arg[1])
|
||||
return
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user