summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2014-10-01 17:43:27 +0000
committerManolo Gouy <Manolo>2014-10-01 17:43:27 +0000
commit7a609f3912abe23f0a75c878cfd6f74f5dbf7501 (patch)
tree7a1f3f755a8b515a33d05dcd914c946079dd21f8 /src
parentecbda612207d3147ca5a5383e65cdc48a60faa77 (diff)
Protect use of dlopen() with HAVE_DLSYM and HAVE_DLFCN_H for compatibility with cases where this function is not available.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10350 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Preferences.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
index 76acabfca..99ab3a917 100644
--- a/src/Fl_Preferences.cxx
+++ b/src/Fl_Preferences.cxx
@@ -40,10 +40,14 @@
#elif defined (__APPLE__)
# include <ApplicationServices/ApplicationServices.h>
# include <unistd.h>
+# include <config.h>
# include <dlfcn.h>
#else
# include <unistd.h>
-# include <dlfcn.h>
+# include <config.h>
+# if HAVE_DLFCN_H
+# include <dlfcn.h>
+# endif
#endif
#ifdef WIN32
@@ -1766,7 +1770,10 @@ int Fl_Plugin_Manager::load(const char *filename) {
#if defined(WIN32) && !defined(__CYGWIN__)
HMODULE dl = LoadLibrary(filename);
#else
- void * dl = dlopen(filename, RTLD_LAZY);
+ void * dl = NULL;
+# if HAVE_DLSYM
+ dl = dlopen(filename, RTLD_LAZY);
+# endif
#endif
// There is no way of unloading a plugin!
return (dl!=0) ? 0 : -1;