SDL GL dynamic loading fix for OpenBSD
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40111
This commit is contained in:
parent
75213d1709
commit
8b57da4c5c
2 changed files with 15 additions and 1 deletions
|
@ -393,7 +393,9 @@ int X11_GL_LoadLibrary(_THIS, const char* path)
|
||||||
|
|
||||||
void *X11_GL_GetProcAddress(_THIS, const char* proc)
|
void *X11_GL_GetProcAddress(_THIS, const char* proc)
|
||||||
{
|
{
|
||||||
|
static char procname[1024];
|
||||||
void* handle;
|
void* handle;
|
||||||
|
void* retval;
|
||||||
|
|
||||||
handle = this->gl_config.dll_handle;
|
handle = this->gl_config.dll_handle;
|
||||||
#if 0 /* This doesn't work correctly yet */
|
#if 0 /* This doesn't work correctly yet */
|
||||||
|
@ -407,7 +409,16 @@ fprintf(stderr, "glXGetProcAddress returned %p and dlsym returned %p for %s\n",
|
||||||
return this->gl_data->glXGetProcAddress(proc);
|
return this->gl_data->glXGetProcAddress(proc);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return dlsym(handle, proc);
|
#if defined(__OpenBSD__) && !defined(__ELF__)
|
||||||
|
#undef dlsym(x,y);
|
||||||
|
#endif
|
||||||
|
retval = dlsym(handle, proc);
|
||||||
|
if (!retval && strlen(proc) <= 1022) {
|
||||||
|
procname[0] = "_";
|
||||||
|
strcpy(procname + 1, proc);
|
||||||
|
retval = dlsym(handle, procname);
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_OPENGL */
|
#endif /* HAVE_OPENGL */
|
||||||
|
|
|
@ -28,6 +28,9 @@ static char rcsid =
|
||||||
#ifdef HAVE_OPENGL
|
#ifdef HAVE_OPENGL
|
||||||
#include <GL/glx.h>
|
#include <GL/glx.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
#if defined(__OpenBSD__) && !defined(__ELF__)
|
||||||
|
#define dlsym(x,y) dlsym(x, "_" y)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#include "SDL_sysvideo.h"
|
#include "SDL_sysvideo.h"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue