mirror of
https://github.com/joel16/SDL2.git
synced 2024-12-13 22:38:34 +00:00
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
@ -393,7 +393,9 @@ int X11_GL_LoadLibrary(_THIS, const char* path)
|
||||
|
||||
void *X11_GL_GetProcAddress(_THIS, const char* proc)
|
||||
{
|
||||
static char procname[1024];
|
||||
void* handle;
|
||||
void* retval;
|
||||
|
||||
handle = this->gl_config.dll_handle;
|
||||
#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);
|
||||
}
|
||||
#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 */
|
||||
|
@ -28,6 +28,9 @@ static char rcsid =
|
||||
#ifdef HAVE_OPENGL
|
||||
#include <GL/glx.h>
|
||||
#include <dlfcn.h>
|
||||
#if defined(__OpenBSD__) && !defined(__ELF__)
|
||||
#define dlsym(x,y) dlsym(x, "_" y)
|
||||
#endif
|
||||
#endif
|
||||
#include "SDL_sysvideo.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user