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
This commit is contained in:
Michael R Sweet
2007-02-09 16:21:55 +00:00
parent 6e9a163035
commit 3439748eaf
+11 -2
View File
@@ -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