[master] 778a457 - Move quadruple_dlopen() to Fl_Posix_System_Driver.cxx where it's used.

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 778a457 - Move quadruple_dlopen() to Fl_Posix_System_Driver.cxx where it's used. "ManoloFLTK" 01:47 Mar 31 top right image
 
commit 778a4577d4db949db3f0aadc32fc227ac025bc56
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Wed Mar 31 10:38:53 2021 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Wed Mar 31 10:39:06 2021 +0200

    Move quadruple_dlopen() to Fl_Posix_System_Driver.cxx where it's used.

 src/drivers/Posix/Fl_Posix_System_Driver.cxx | 24 ++++++++++++++++++++++++
 src/drivers/X11/Fl_X11_System_Driver.cxx     | 22 ----------------------
 2 files changed, 24 insertions(+), 22 deletions(-)

diff --git src/drivers/Posix/Fl_Posix_System_Driver.cxx src/drivers/Posix/Fl_Posix_System_Driver.cxx
index f932442..4a8ccda 100644
--- src/drivers/Posix/Fl_Posix_System_Driver.cxx
+++ src/drivers/Posix/Fl_Posix_System_Driver.cxx
@@ -171,6 +171,30 @@ int Fl_Posix_System_Driver::run_program(const char *program, char **argv, char *
   return 1;
 }
 
+
+#if HAVE_DLSYM && HAVE_DLFCN_H
+static void* quadruple_dlopen(const char *libname)
+{
+  char filename2[FL_PATH_MAX];
+  sprintf(filename2, "%s.so", libname);
+  void *ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL);
+  if (!ptr) {
+    sprintf(filename2, "%s.so.2", libname);
+    ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL);
+    if (!ptr) {
+      sprintf(filename2, "%s.so.1", libname);
+      ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL);
+      if (!ptr) {
+        sprintf(filename2, "%s.so.0", libname);
+        ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL);
+      }
+    }
+  }
+  return ptr;
+}
+#endif
+
+
 /**
  Returns the run-time address of a function or of a shared library.
  \param lib_name shared library name (without its extension) or NULL to search the function in the running program
diff --git src/drivers/X11/Fl_X11_System_Driver.cxx src/drivers/X11/Fl_X11_System_Driver.cxx
index c16133e..8beed26 100644
--- src/drivers/X11/Fl_X11_System_Driver.cxx
+++ src/drivers/X11/Fl_X11_System_Driver.cxx
@@ -569,28 +569,6 @@ int Fl_X11_System_Driver::utf8locale() {
   return ret;
 }
 
-#if HAVE_DLSYM && HAVE_DLFCN_H
-static void* quadruple_dlopen(const char *libname)
-{
-  char filename2[FL_PATH_MAX];
-  sprintf(filename2, "%s.so", libname);
-  void *ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL);
-  if (!ptr) {
-    sprintf(filename2, "%s.so.2", libname);
-    ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL);
-    if (!ptr) {
-      sprintf(filename2, "%s.so.1", libname);
-      ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL);
-      if (!ptr) {
-        sprintf(filename2, "%s.so.0", libname);
-        ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL);
-      }
-    }
-  }
-  return ptr;
-}
-#endif
-
 
 #if !defined(FL_DOXYGEN)
 
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.