diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-06 07:58:38 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-06 07:58:38 +0100 |
| commit | 6ccd71697d3be8a3d7fce055c32d645eebfc30c1 (patch) | |
| tree | e4e0a88dee83a2edbfc68abbe71b339b55ea9733 | |
| parent | 4b945a3086011b6a59b5aef434cdbe8cda96c2de (diff) | |
Allow using native file chooser on Darwin + XQuartz + (homebrew or fink)
| -rw-r--r-- | src/drivers/Posix/Fl_Posix_System_Driver.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx index 6e90cb5eb..63d5d6101 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx @@ -216,17 +216,21 @@ void *Fl_Posix_System_Driver::dlopen_or_dlsym(const char *lib_name, const char * #endif if (func_ptr) return func_ptr; } -#ifdef __APPLE_CC__ // allows testing on Darwin + XQuartz + fink +#ifdef __APPLE_CC__ // allows using on Darwin + XQuartz + (homebrew or fink) if (lib_name) { char path[FL_PATH_MAX]; snprintf(path, FL_PATH_MAX, "/opt/X11/lib/%s.dylib", lib_name); lib_address = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); if (!lib_address) { - snprintf(path, FL_PATH_MAX, "/opt/sw/lib/%s.dylib", lib_name); + snprintf(path, FL_PATH_MAX, "/opt/homebrew/lib/%s.dylib", lib_name); lib_address = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); if (!lib_address) { - snprintf(path, FL_PATH_MAX, "/sw/lib/%s.dylib", lib_name); + snprintf(path, FL_PATH_MAX, "/opt/sw/lib/%s.dylib", lib_name); lib_address = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); + if (!lib_address) { + snprintf(path, FL_PATH_MAX, "/sw/lib/%s.dylib", lib_name); + lib_address = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); + } } } } |
