Patched to compile if Wayland is disabled via SDL_config.h (thanks, Martin!). Fixes Bugzilla #2351.
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c
index 3af798d..6178574 100644
--- a/src/video/wayland/SDL_waylandevents.c
+++ b/src/video/wayland/SDL_waylandevents.c
@@ -21,6 +21,8 @@
#include "../../SDL_internal.h"
+#if SDL_VIDEO_DRIVER_WAYLAND
+
#include "SDL_stdinc.h"
#include "SDL_assert.h"
@@ -380,4 +382,6 @@ void Wayland_display_destroy_input(SDL_VideoData *d)
d->input = NULL;
}
+#endif /* SDL_VIDEO_DRIVER_WAYLAND */
+
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c
index 3609db6..ae634b6 100644
--- a/src/video/wayland/SDL_waylandmouse.c
+++ b/src/video/wayland/SDL_waylandmouse.c
@@ -19,6 +19,10 @@
3. This notice may not be removed or altered from any source distribution.
*/
+#include "../../SDL_internal.h"
+
+#if SDL_VIDEO_DRIVER_WAYLAND
+
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
@@ -31,7 +35,6 @@
#include <stdlib.h>
#include <limits.h>
-#include "../../SDL_internal.h"
#include "../SDL_sysvideo.h"
#include "SDL_mouse.h"
@@ -44,7 +47,6 @@
#include "SDL_assert.h"
-#if SDL_VIDEO_DRIVER_WAYLAND
typedef struct {
struct wl_buffer *buffer;
@@ -407,4 +409,4 @@ Wayland_FiniMouse(void)
mouse->WarpMouse = NULL;
mouse->SetRelativeMouseMode = NULL;
}
-#endif
+#endif /* SDL_VIDEO_DRIVER_WAYLAND */
diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c
index b8db469..0d4ff19 100644
--- a/src/video/wayland/SDL_waylandvideo.c
+++ b/src/video/wayland/SDL_waylandvideo.c
@@ -21,6 +21,8 @@
#include "../../SDL_internal.h"
+#if SDL_VIDEO_DRIVER_WAYLAND
+
#include "SDL_video.h"
#include "SDL_mouse.h"
#include "SDL_stdinc.h"
@@ -429,4 +431,6 @@ Wayland_VideoQuit(_THIS)
_this->driverdata = NULL;
}
+#endif /* SDL_VIDEO_DRIVER_WAYLAND */
+
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index 090c494..3b3fc1a 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -21,6 +21,8 @@
#include "../../SDL_internal.h"
+#if SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL
+
#include "../SDL_sysvideo.h"
#include "../../events/SDL_windowevents_c.h"
#include "../SDL_egl_c.h"
@@ -236,4 +238,6 @@ void Wayland_DestroyWindow(_THIS, SDL_Window *window)
}
}
+#endif /* SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL */
+
/* vi: set ts=4 sw=4 expandtab: */