Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling for MacOS in require.lua #1190

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Zframework/require.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ return function(libName)
return
end
if SYSTEM=='macOS' then
require=package.loadlib(libName..'.dylib','luaopen_'..libName)
success,res=pcall(require)
local a,b,c=package.loadlib(libName..'.dylib','luaopen_'..libName)
require=a

if require then
success,res=pcall(require)
else
success,res=false,'package.loadlib returned nil, along with:\n[2]:\n'..b..'[3]:\n'..c
end
else
if SYSTEM=='Android' and not loaded[libName] then
local platform=(function()
Expand Down
Loading