comparison src/video/x11/SDL_x11gl.c @ 110:7edee9f0f2cc

SDL GL dynamic loading fix for OpenBSD
author Sam Lantinga <slouken@lokigames.com>
date Sat, 14 Jul 2001 19:11:26 +0000
parents a8360daed17d
children 0bcae11eba14
comparison
equal deleted inserted replaced
109:5a9c36a45db1 110:7edee9f0f2cc
391 return 0; 391 return 0;
392 } 392 }
393 393
394 void *X11_GL_GetProcAddress(_THIS, const char* proc) 394 void *X11_GL_GetProcAddress(_THIS, const char* proc)
395 { 395 {
396 static char procname[1024];
396 void* handle; 397 void* handle;
398 void* retval;
397 399
398 handle = this->gl_config.dll_handle; 400 handle = this->gl_config.dll_handle;
399 #if 0 /* This doesn't work correctly yet */ 401 #if 0 /* This doesn't work correctly yet */
400 if ( this->gl_data->glXGetProcAddress ) { 402 if ( this->gl_data->glXGetProcAddress ) {
401 void *func, *func2; 403 void *func, *func2;
405 fprintf(stderr, "glXGetProcAddress returned %p and dlsym returned %p for %s\n", func, func2, proc); 407 fprintf(stderr, "glXGetProcAddress returned %p and dlsym returned %p for %s\n", func, func2, proc);
406 } 408 }
407 return this->gl_data->glXGetProcAddress(proc); 409 return this->gl_data->glXGetProcAddress(proc);
408 } 410 }
409 #endif 411 #endif
410 return dlsym(handle, proc); 412 #if defined(__OpenBSD__) && !defined(__ELF__)
413 #undef dlsym(x,y);
414 #endif
415 retval = dlsym(handle, proc);
416 if (!retval && strlen(proc) <= 1022) {
417 procname[0] = "_";
418 strcpy(procname + 1, proc);
419 retval = dlsym(handle, procname);
420 }
421 return retval;
411 } 422 }
412 423
413 #endif /* HAVE_OPENGL */ 424 #endif /* HAVE_OPENGL */