From 6ccd71697d3be8a3d7fce055c32d645eebfc30c1 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sun, 6 Nov 2022 07:58:38 +0100 Subject: Allow using native file chooser on Darwin + XQuartz + (homebrew or fink) --- src/drivers/Posix/Fl_Posix_System_Driver.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/drivers') 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); + } } } } -- cgit v1.2.3