wayland: Minor fixes for old compilers
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
diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c
index 9ceb9aa..6a55e7b 100644
--- a/src/video/wayland/SDL_waylandvideo.c
+++ b/src/video/wayland/SDL_waylandvideo.c
@@ -640,7 +640,8 @@ Wayland_free_display(uint32_t id)
static void
Wayland_init_xdg_output(SDL_VideoData *d)
{
- for (SDL_WaylandOutputData *node = (SDL_WaylandOutputData*)d->output_list; node != NULL; node = (SDL_WaylandOutputData*)node->next) {
+ SDL_WaylandOutputData *node;
+ for (node = (SDL_WaylandOutputData*)d->output_list; node != NULL; node = (SDL_WaylandOutputData*)node->next) {
node->xdg_output = zxdg_output_manager_v1_get_xdg_output(node->videodata->xdg_output_manager, node->output);
zxdg_output_v1_add_listener(node->xdg_output, &xdg_output_listener, node);
}
diff --git a/src/video/wayland/SDL_waylandvideo.h b/src/video/wayland/SDL_waylandvideo.h
index cab8aca..c3a8c13 100644
--- a/src/video/wayland/SDL_waylandvideo.h
+++ b/src/video/wayland/SDL_waylandvideo.h
@@ -47,6 +47,8 @@ typedef struct {
int size;
} SDL_WaylandCursorTheme;
+typedef struct SDL_WaylandOutputData SDL_WaylandOutputData;
+
typedef struct {
SDL_bool initializing;
struct wl_display *display;
@@ -80,7 +82,7 @@ typedef struct {
struct xkb_context *xkb_context;
struct SDL_WaylandInput *input;
struct SDL_WaylandTabletManager *tablet_manager;
- struct SDL_WaylandOutputData *output_list;
+ SDL_WaylandOutputData *output_list;
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
struct SDL_WaylandTouch *touch;
@@ -93,7 +95,7 @@ typedef struct {
int relative_mouse_mode;
} SDL_VideoData;
-typedef struct {
+struct SDL_WaylandOutputData {
SDL_VideoData *videodata;
struct wl_output *output;
struct zxdg_output_v1 *xdg_output;
@@ -106,8 +108,8 @@ typedef struct {
int index;
SDL_VideoDisplay placeholder;
int wl_output_done_count;
- struct SDL_WaylandOutputData *next;
-} SDL_WaylandOutputData;
+ SDL_WaylandOutputData *next;
+};
/* Needed here to get wl_surface declaration, fixes GitHub#4594 */
#include "SDL_waylanddyn.h"