소스 검색

wayland: Check that all required dynamic symbols have been successfully resolved at init time

Ensure that all hard dependencies are resolved when dynamically loading the libraries required for the Wayland backend and fail gracefully if a required module was not initialized successfully.
Frank Praznik 3 년 전
부모
커밋
e22f5ed7d3
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      src/video/wayland/SDL_waylanddyn.c

+ 5 - 2
src/video/wayland/SDL_waylanddyn.c

@@ -152,8 +152,11 @@ int SDL_WAYLAND_LoadSymbols(void)
 #define SDL_WAYLAND_INTERFACE(iface)        WAYLAND_##iface = (struct wl_interface *)WAYLAND_GetSym(#iface, thismod, SDL_TRUE);
 #define SDL_WAYLAND_INTERFACE(iface)        WAYLAND_##iface = (struct wl_interface *)WAYLAND_GetSym(#iface, thismod, SDL_TRUE);
 #include "SDL_waylandsym.h"
 #include "SDL_waylandsym.h"
 
 
-        if (SDL_WAYLAND_HAVE_WAYLAND_CLIENT) {
-            /* all required symbols loaded. */
+        if (SDL_WAYLAND_HAVE_WAYLAND_CLIENT &&
+            SDL_WAYLAND_HAVE_WAYLAND_CURSOR &&
+            SDL_WAYLAND_HAVE_WAYLAND_EGL &&
+            SDL_WAYLAND_HAVE_WAYLAND_XKB) {
+            /* All required symbols loaded, only libdecor is optional. */
             SDL_ClearError();
             SDL_ClearError();
         } else {
         } else {
             /* in case something got loaded... */
             /* in case something got loaded... */