From c59880f170c18e9b12a8546a96bed924f234a590 Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Fri, 8 May 2020 01:42:43 +0200 Subject: [PATCH] Maybe fix some Mac OS X crash. --- makefile | 2 +- src/raylua_e.c | 6 +++++- src/raylua_s.c | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index e3a1ab1..b8b8e16 100644 --- a/makefile +++ b/makefile @@ -12,7 +12,7 @@ MODULES := raymath rlgl easings gestures physac raygui ifeq ($(OS),Windows_NT) LDFLAGS += -lopengl32 -lgdi32 -lwinmm -static else ifeq ($(shell uname),Darwin) - LDFLAGS += -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL + LDFLAGS += -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL -Wl,"-pagezero_size 10000 -image_base 100000000" else LDFLAGS += -ldl -lX11 -lpthread endif diff --git a/src/raylua_e.c b/src/raylua_e.c index d1d2ad2..1bb9bf5 100644 --- a/src/raylua_e.c +++ b/src/raylua_e.c @@ -152,8 +152,12 @@ int main(int argc, const char **argv) lua_State *L = luaL_newstate(); luaL_openlibs(L); - if (L == NULL) + if (L == NULL) { puts("RAYLUA: Unable to initialize Lua."); + return 0; + } + + luaL_openlibs(L); /* Populate arg. */ lua_newtable(L); diff --git a/src/raylua_s.c b/src/raylua_s.c index 979e5b6..2a03210 100644 --- a/src/raylua_s.c +++ b/src/raylua_s.c @@ -27,11 +27,13 @@ int main(int argc, const char **argv) { lua_State *L = luaL_newstate(); - luaL_openlibs(L); - if (L == NULL) + if (L == NULL) { puts("RAYLUA: Unable to initialize Lua."); + return 0; + } + luaL_openlibs(L); lua_newtable(L); int i = 0;