Skip to content

Commit

Permalink
Fixed bug 5215 - Fixing filenames passed to dlopen for OpenBSD
Browse files Browse the repository at this point in the history
Brad Smith

Attached is a patch to use the proper filenames when trying to dlopen the respective shared libraries on OpenBSD.
  • Loading branch information
slouken committed Sep 8, 2020
1 parent 1b6de9a commit 8709f67
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/video/SDL_egl.c
Expand Up @@ -72,6 +72,13 @@
#define DEFAULT_OGL_ES_PVR "libGLES_CM.dylib" //???
#define DEFAULT_OGL_ES "libGLESv1_CM.dylib" //???

#elif defined(__OpenBSD__)
#define DEFAULT_OGL "libGL.so"
#define DEFAULT_EGL "libEGL.so"
#define DEFAULT_OGL_ES2 "libGLESv2.so"
#define DEFAULT_OGL_ES_PVR "libGLES_CM.so"
#define DEFAULT_OGL_ES "libGLESv1_CM.so"

#else
/* Desktop Linux */
#define DEFAULT_OGL "libGL.so.1"
Expand Down
8 changes: 7 additions & 1 deletion src/video/wayland/SDL_waylandvulkan.c
Expand Up @@ -36,6 +36,12 @@
#include "SDL_waylandvulkan.h"
#include "SDL_syswm.h"

#if defined(__OpenBSD__)
#define DEFAULT_VULKAN "libvulkan.so"
#else
#define DEFAULT_VULKAN "libvulkan.so.1"
#endif

int Wayland_Vulkan_LoadLibrary(_THIS, const char *path)
{
VkExtensionProperties *extensions = NULL;
Expand All @@ -50,7 +56,7 @@ int Wayland_Vulkan_LoadLibrary(_THIS, const char *path)
if(!path)
path = SDL_getenv("SDL_VULKAN_LIBRARY");
if(!path)
path = "libvulkan.so.1";
path = DEFAULT_VULKAN;
_this->vulkan_config.loader_handle = SDL_LoadObject(path);
if(!_this->vulkan_config.loader_handle)
return -1;
Expand Down
9 changes: 8 additions & 1 deletion src/video/x11/SDL_x11vulkan.c
Expand Up @@ -30,6 +30,13 @@

#include <X11/Xlib.h>
/*#include <xcb/xcb.h>*/

#if defined(__OpenBSD__)
#define DEFAULT_VULKAN "libvulkan.so"
#else
#define DEFAULT_VULKAN "libvulkan.so.1"
#endif

/*
typedef uint32_t xcb_window_t;
typedef uint32_t xcb_visualid_t;
Expand All @@ -52,7 +59,7 @@ int X11_Vulkan_LoadLibrary(_THIS, const char *path)
if(!path)
path = SDL_getenv("SDL_VULKAN_LIBRARY");
if(!path)
path = "libvulkan.so.1";
path = DEFAULT_VULKAN;
_this->vulkan_config.loader_handle = SDL_LoadObject(path);
if(!_this->vulkan_config.loader_handle)
return -1;
Expand Down

0 comments on commit 8709f67

Please sign in to comment.