瀏覽代碼

tray: Load GTK and libappindicator by versioned names, except on OpenBSD

We are expecting a specific ABI (we can see that from the declarations
listed in this file) and the whole point of SONAME versioning is to
say that the library conforms to a specific ABI. If the SONAME is not
the one we expect, then calling its functions is likely to crash.

As usual, an exception to this is that OpenBSD does not use SONAME
versioning.

Signed-off-by: Simon McVittie <[email protected]>
Simon McVittie 7 月之前
父節點
當前提交
4290fc8bda
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      src/tray/unix/SDL_tray.c

+ 10 - 1
src/tray/unix/SDL_tray.c

@@ -174,22 +174,31 @@ static void quit_gtk(void)
 }
 }
 
 
 const char *appindicator_names[] = {
 const char *appindicator_names[] = {
+#ifdef SDL_PLATFORM_OPENBSD
     "libayatana-appindicator3.so",
     "libayatana-appindicator3.so",
-    "libayatana-appindicator3.so.1",
     "libappindicator3.so",
     "libappindicator3.so",
+#else
+    "libayatana-appindicator3.so.1",
     "libappindicator3.so.1",
     "libappindicator3.so.1",
+#endif
     NULL
     NULL
 };
 };
 
 
 const char *gtk_names[] = {
 const char *gtk_names[] = {
+#ifdef SDL_PLATFORM_OPENBSD
     "libgtk-3.so",
     "libgtk-3.so",
+#else
     "libgtk-3.so.0",
     "libgtk-3.so.0",
+#endif
     NULL
     NULL
 };
 };
 
 
 const char *gdk_names[] = {
 const char *gdk_names[] = {
+#ifdef SDL_PLATFORM_OPENBSD
     "libgdk-3.so",
     "libgdk-3.so",
+#else
     "libgdk-3.so.0",
     "libgdk-3.so.0",
+#endif
     NULL
     NULL
 };
 };