Skip to content

Commit 4290fc8

Browse files
smcvslouken
authored andcommitted
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 <smcv@collabora.com>
1 parent 6b38d25 commit 4290fc8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/tray/unix/SDL_tray.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -174,22 +174,31 @@ static void quit_gtk(void)
174174
}
175175

176176
const char *appindicator_names[] = {
177+
#ifdef SDL_PLATFORM_OPENBSD
177178
"libayatana-appindicator3.so",
178-
"libayatana-appindicator3.so.1",
179179
"libappindicator3.so",
180+
#else
181+
"libayatana-appindicator3.so.1",
180182
"libappindicator3.so.1",
183+
#endif
181184
NULL
182185
};
183186

184187
const char *gtk_names[] = {
188+
#ifdef SDL_PLATFORM_OPENBSD
185189
"libgtk-3.so",
190+
#else
186191
"libgtk-3.so.0",
192+
#endif
187193
NULL
188194
};
189195

190196
const char *gdk_names[] = {
197+
#ifdef SDL_PLATFORM_OPENBSD
191198
"libgdk-3.so",
199+
#else
192200
"libgdk-3.so.0",
201+
#endif
193202
NULL
194203
};
195204

0 commit comments

Comments
 (0)