From 732fce9a04084baf67666faebaed13c6d9ef2c71 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 1 Feb 2021 23:18:06 +0100 Subject: [PATCH] (SDL2) Add ifdefs for HAVE_X11 and HAVE_WAYLAND --- gfx/drivers/sdl2_gfx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gfx/drivers/sdl2_gfx.c b/gfx/drivers/sdl2_gfx.c index 6045b1e6be..800da4c54c 100644 --- a/gfx/drivers/sdl2_gfx.c +++ b/gfx/drivers/sdl2_gfx.c @@ -443,12 +443,19 @@ static void *sdl2_gfx_init(const video_info_t *video, #elif defined(HAVE_COCOA) sdl2_set_handles(vid->window, RARCH_DISPLAY_OSX); #else +#if defined(HAVE_X11) || defined(HAVE_WAYLAND) const char *video_driver = SDL_GetCurrentVideoDriver(); +#endif +#ifdef HAVE_X11 if (strcmp(video_driver, "x11") == 0) sdl2_set_handles(vid->window, RARCH_DISPLAY_X11); - else if (strcmp(video_driver, "wayland") == 0) + else +#endif +#ifdef HAVE_WAYLAND + if (strcmp(video_driver, "wayland") == 0) sdl2_set_handles(vid->window, RARCH_DISPLAY_WAYLAND); else +#endif sdl2_set_handles(vid->window, RARCH_DISPLAY_NONE); #endif