Skip to content

Commit 54757c2

Browse files
smcvslouken
authored andcommitted
x11vulkan: Use the correct SONAME of libX11-xcb.so.1 on Linux, etc.
On most Unix platforms supported by SDL, the canonical name used to load a library at runtime includes its ABI major version, and the name without a version is not guaranteed to exist on non-developer systems. libX11-xcb.so.1 is correct on Linux, and probably on other Unix platforms like FreeBSD. A notable exception is OpenBSD, which apparently does not use ABI-suffixed names, so continue to use libX11-xcb.so there. Signed-off-by: Simon McVittie <[email protected]> (cherry picked from commit 7713a7e)
1 parent f5ed158 commit 54757c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/video/x11/SDL_x11vulkan.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232

3333
#if defined(__OpenBSD__)
3434
#define DEFAULT_VULKAN "libvulkan.so"
35+
#define DEFAULT_X11_XCB "libX11-xcb.so"
3536
#else
3637
#define DEFAULT_VULKAN "libvulkan.so.1"
38+
#define DEFAULT_X11_XCB "libX11-xcb.so.1"
3739
#endif
3840

3941
/*
@@ -108,7 +110,7 @@ int X11_Vulkan_LoadLibrary(_THIS, const char *path)
108110
} else {
109111
const char *libX11XCBLibraryName = SDL_getenv("SDL_X11_XCB_LIBRARY");
110112
if (!libX11XCBLibraryName) {
111-
libX11XCBLibraryName = "libX11-xcb.so";
113+
libX11XCBLibraryName = DEFAULT_X11_XCB;
112114
}
113115
videoData->vulkan_xlib_xcb_library = SDL_LoadObject(libX11XCBLibraryName);
114116
if (!videoData->vulkan_xlib_xcb_library) {

0 commit comments

Comments
 (0)