Skip to contentSkip to conversation

sdl2: fix build failure on windows

PATCH In review Gerd Hoffmann 3 participants 3 messages Jan 13, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sdl2: fix build failure on windows

Cc Stefan Weil <[email protected]>
Cc Samuel Thibault <[email protected]>
---
 ui/sdl2.c | 6 ++++++
 1 file changed, 6 insertions(+)
ui/sdl2.c +6 -0
index 9a79b17..91fb111 100644
@@ -817,9 +817,15 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
         sdl2_console[i].dcl.con = con;
         register_displaychangelistener(&sdl2_console[i].dcl);
 
+#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_X11)
         if (SDL_GetWindowWMInfo(sdl2_console[i].real_window, &info)) {
+#if defined(SDL_VIDEO_DRIVER_WINDOWS)
+            qemu_console_set_window_id(con, (uintptr_t)info.info.win.window);
+#elif defined(SDL_VIDEO_DRIVER_X11)
             qemu_console_set_window_id(con, info.info.x11.window);
+#endif
         }
+#endif
     }
 
     /* Load a 32x32x4 image. White pixels are transparent. */
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw

Am 13.01.2017 um 09:14 schrieb Gerd Hoffmann:

Quoted 17 lines
Cc Stefan Weil <[email protected]>
Cc Samuel Thibault <[email protected]>
---
 ui/sdl2.c | 6 ++++++
 1 file changed, 6 insertions(+)
ui/sdl2.c +1 -0
index 9a79b17..91fb111 100644
@@ -817,9 +817,15 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
         sdl2_console[i].dcl.con = con;
         register_displaychangelistener(&sdl2_console[i].dcl);
 
+#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_X11)
         if (SDL_GetWindowWMInfo(sdl2_console[i].real_window, &info)) {

ui/sdl2.c void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) · line 831

Quoted 10 lines
ui/sdl2.c +5 -0
+#if defined(SDL_VIDEO_DRIVER_WINDOWS)
+            qemu_console_set_window_id(con, (uintptr_t)info.info.win.window);
+#elif defined(SDL_VIDEO_DRIVER_X11)
             qemu_console_set_window_id(con, info.info.x11.window);
+#endif
         }
+#endif
     }
 
     /* Load a 32x32x4 image. White pixels are transparent. */

Thanks.

#2 lore raw
Quoted 27 lines · Stefan Weil

Am 13.01.2017 um 09:14 schrieb Gerd Hoffmann:

Quoted 26 lines
Cc Stefan Weil <[email protected]>
Cc Samuel Thibault <[email protected]>
---
 ui/sdl2.c | 6 ++++++
 1 file changed, 6 insertions(+)
ui/sdl2.c +6 -0
index 9a79b17..91fb111 100644
@@ -817,9 +817,15 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
         sdl2_console[i].dcl.con = con;
         register_displaychangelistener(&sdl2_console[i].dcl);
 
+#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_X11)
         if (SDL_GetWindowWMInfo(sdl2_console[i].real_window, &info)) {
+#if defined(SDL_VIDEO_DRIVER_WINDOWS)
+            qemu_console_set_window_id(con, (uintptr_t)info.info.win.window);
+#elif defined(SDL_VIDEO_DRIVER_X11)
             qemu_console_set_window_id(con, info.info.x11.window);
+#endif
         }
+#endif
     }
 
Quoted 6 lines

ui/sdl2.c void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) · line 831

Quoted 1 line
ui/sdl2.c +0 -0
     /* Load a 32x32x4 image. White pixels are transparent. */

Thanks.

Thanks; applied to master as a buildfix.

-- PMM