wayland: don't define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_* macro's They mess with #ifdef conditional in headers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
diff --git a/src/video/wayland/SDL_waylanddyn.c b/src/video/wayland/SDL_waylanddyn.c
index a8223b2..d212312 100644
--- a/src/video/wayland/SDL_waylanddyn.c
+++ b/src/video/wayland/SDL_waylanddyn.c
@@ -37,34 +37,29 @@ typedef struct
const char *libname;
} waylanddynlib;
-#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
-#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
-#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
-#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
-#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR NULL
-#endif
-
static waylanddynlib waylandlibs[] = {
+#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC },
- { NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL },
+#endif
+#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR },
+#endif
+#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON },
- { NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR }
+#endif
+#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
+ { NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR },
+#endif
+ { NULL, NULL }
};
static void *WAYLAND_GetSym(const char *fnname, int *pHasModule, SDL_bool required)
{
- int i;
void *fn = NULL;
- for (i = 0; i < SDL_TABLESIZE(waylandlibs); i++) {
- if (waylandlibs[i].lib != NULL) {
- fn = SDL_LoadFunction(waylandlibs[i].lib, fnname);
+ waylanddynlib *dynlib;
+ for (dynlib = waylandlibs; dynlib->libname; dynlib++) {
+ if (dynlib->lib != NULL) {
+ fn = SDL_LoadFunction(dynlib->lib, fnname);
if (fn != NULL) {
break;
}
@@ -72,10 +67,11 @@ static void *WAYLAND_GetSym(const char *fnname, int *pHasModule, SDL_bool requir
}
#if DEBUG_DYNAMIC_WAYLAND
- if (fn != NULL)
- SDL_Log("WAYLAND: Found '%s' in %s (%p)\n", fnname, waylandlibs[i].libname, fn);
- else
+ if (fn != NULL) {
+ SDL_Log("WAYLAND: Found '%s' in %s (%p)\n", fnname, dynlib->libname, fn);
+ } else {
SDL_Log("WAYLAND: Symbol '%s' NOT FOUND!\n", fnname);
+ }
#endif
if (fn == NULL && required) {