Skip to content

Commit

Permalink
Add further dlopen debugging for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk committed Jan 25, 2024
1 parent 7edb4b6 commit 796d54c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions include/hx/CFFINekoLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ void *LoadNekoFunc(const char *inName)
sNekoDllHandle = GetModuleHandleA("neko.dll");
#else
sNekoDllHandle = dlopen("libneko." NEKO_EXT, RTLD_NOW);
#ifdef HX_MACOS
// The debian package creates libneko.so.0 without libneko.so...
// The fedora/openSUSE rpm packages create libneko.so.1...
if (!sNekoDllHandle) {
fprintf(stderr, dlerror());
fprintf(stderr, "\n");
sNekoDllHandle = dlopen("libneko.0." NEKO_EXT, RTLD_NOW);
}
if (!sNekoDllHandle) {
fprintf(stderr, dlerror());
fprintf(stderr, "\n");
sNekoDllHandle = dlopen("libneko.1." NEKO_EXT, RTLD_NOW);
}
if (!sNekoDllHandle) {
fprintf(stderr, dlerror());
fprintf(stderr, "\n");
sNekoDllHandle = dlopen("libneko.2." NEKO_EXT, RTLD_NOW);
}
#else
// The debian package creates libneko.so.0 without libneko.so...
// The fedora/openSUSE rpm packages create libneko.so.1...
if (!sNekoDllHandle)
Expand All @@ -35,10 +54,12 @@ void *LoadNekoFunc(const char *inName)
if (!sNekoDllHandle)
sNekoDllHandle = dlopen("libneko." NEKO_EXT ".2", RTLD_NOW);
#endif
#endif

if (!sNekoDllHandle)
{
fprintf(stderr, dlerror());
fprintf(stderr, "\n");

fprintf(stderr,"Could not link to neko.\n");
return 0;
Expand Down

0 comments on commit 796d54c

Please sign in to comment.