diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-10-02 12:18:08 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-10-02 12:18:18 +0200 |
| commit | 46598229a9605b25e3da5e0d7ad41343cf429497 (patch) | |
| tree | d492bcc7c4cb4fddb681b6c08b5a719d99debdbd /src/drivers/Posix | |
| parent | 7f2e20627992042577222fcb474a093398a91c30 (diff) | |
Have Fl_X11_System_Driver::newUUID() use uuid_generate() if available at run-time.
The code falls back to the ad-hoc method if uuid_generate() isn't available.
Diffstat (limited to 'src/drivers/Posix')
| -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 0fa037b42..a05781d1b 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx @@ -47,13 +47,17 @@ #if HAVE_DLFCN_H -static void* double_dlopen(const char *filename1) +static void* triple_dlopen(const char *filename1) { void *ptr = ::dlopen(filename1, RTLD_LAZY | RTLD_GLOBAL); if (!ptr) { char filename2[FL_PATH_MAX]; - sprintf(filename2, "%s.0", filename1); + sprintf(filename2, "%s.1", filename1); ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL); + if (!ptr) { + sprintf(filename2, "%s.0", filename1); + ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL); + } } return ptr; } @@ -63,7 +67,7 @@ void *Fl_Posix_System_Driver::dlopen(const char *filename) { void *ptr = NULL; #if HAVE_DLFCN_H - ptr = double_dlopen(filename); + ptr = triple_dlopen(filename); # ifdef __APPLE_CC__ // allows testing on Darwin + XQuartz + fink if (!ptr) { char *f_dylib = (char*)malloc(strlen(filename)+7); |
