summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2007-02-09 16:21:55 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2007-02-09 16:21:55 +0000
commit3439748eaf61f9e6af7c8a3df3cf042828e60532 (patch)
tree2fd94cdbf39dc2ff68786a3e6c545557b0d60fa9 /src
parent6e9a1630357a21c6ef6357cdde324ae89a565826 (diff)
Don't depend on having RTLD_DEFAULT defined
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5684 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/glut_compatability.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/glut_compatability.cxx b/src/glut_compatability.cxx
index 0f768a4dc..52bedf12a 100644
--- a/src/glut_compatability.cxx
+++ b/src/glut_compatability.cxx
@@ -448,8 +448,19 @@ GLUTproc glutGetProcAddress(const char *procName) {
snprintf(symbol, sizeof(symbol), "_%s", procName);
+# ifdef RTLD_DEFAULT
return (GLUTproc)dlsym(RTLD_DEFAULT, symbol);
+# else // No RTLD_DEFAULT support, so open the current a.out symbols...
+ static void *rtld_default = 0;
+
+ if (!rtld_default) rtld_default = dlopen(0, RTLD_LAZY);
+
+ if (rtld_default) return (GLUTproc)dlsym(rtld_default, symbol);
+ else return 0;
+
+# endif // RTLD_DEFAULT
+
# elif defined(HAVE_GLXGETPROCADDRESSARB)
return (GLUTproc)glXGetProcAddressARB((const GLubyte *)procName);
@@ -485,8 +496,6 @@ int glutExtensionSupported( const char* extension )
/* skip the false match and continue */
extensions = p + len;
}
-
- return 0;
}
#endif // HAVE_GL