some changes for rpi (#546)

disable coopnet on rpi until we can get some valid libraries compiled
This commit is contained in:
Isaac0-dev 2023-11-27 12:04:10 +10:00 committed by MysterD
parent ffcef729e7
commit dd278f0b3f
2 changed files with 6 additions and 7 deletions

View File

@ -270,6 +270,7 @@ endif
ifeq ($(TARGET_RPI),1)
$(info Compiling for Raspberry Pi)
DISCORD_SDK := 0
COOPNET := 0
machine = $(shell sh -c 'uname -m 2>/dev/null || echo unknown')
# Raspberry Pi B+, Zero, etc

View File

@ -417,15 +417,14 @@ void smlua_push_object(lua_State* L, u16 lot, void* p) {
lua_pushnil(L);
return;
}
u64 pointer = (uintptr_t) p;
// add to allowlist
smlua_cobject_allowlist_add(lot, pointer);
smlua_cobject_allowlist_add(lot, (u64)(intptr_t) p);
// get a cobject from a function
lua_getglobal(L, "_NewCObject"); // Get the function by its global name
lua_pushinteger(L, lot);
lua_pushinteger(L, pointer);
lua_pushinteger(L, (u64)(intptr_t) p);
if (lua_pcall(L, 2, 1, 0) != LUA_OK) {
LOG_ERROR("Error calling Lua function: %s\n", lua_tostring(L, -1));
@ -438,13 +437,12 @@ void smlua_push_pointer(lua_State* L, u16 lvt, void* p) {
return;
}
u64 pointer = (uintptr_t) p;
smlua_cpointer_allowlist_add(lvt, pointer);
smlua_cpointer_allowlist_add(lvt, (u64)(intptr_t) p);
// get a cpointer from a function
lua_getglobal(L, "_NewCPointer"); // Get the function by its global name
lua_pushinteger(L, lvt);
lua_pushinteger(L, pointer);
lua_pushinteger(L, (u64)(intptr_t) p);
if (lua_pcall(L, 2, 1, 0) != LUA_OK) {
LOG_ERROR("Error calling Lua function: %s\n", lua_tostring(L, -1));
}