Fix a compile error when none of the definesis hit
Quoted 10 lines
Quoted 2 lines · Liu Yu
Signed-off-by Liu Yu <[email protected]>What particularly circumstance would this be, --disable-sdl?
Quoted 4 lines
--- vl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Quoted 13 lines
vl.c int main(int argc, char **argv, char **envp) · line 5553
Quoted 11 lines
vl.c +2
-0@@ -5548,6 +5548,8 @@ int main(int argc, char **argv, char **envp)sdl_display_init (ds, full_screen, no_frame);#elif defined(CONFIG_COCOA )cocoa_display_init (ds, full_screen); +#else + ;I'd rather see something like do {} while (0); with a comment.
Or something like this ?
#if defined(CONFIG_SDL)
if (sdl || !vnc_display)
sdl_display_init(ds, full_screen, no_frame);
#elif defined(CONFIG_COCOA)
if (sdl || !vnc_display)
cocoa_display_init(ds, full_screen);#endif
Laurent
[email protected] writes ("Re: [Qemu-devel] [PATCH] Fix a compile error when none of the definesis hit"):
Quoted 2 lines
[Anthony:]
Quoted 1 line
I'd rather see something like do {} while (0); with a comment.
This is all rather mystifying to me. What's wrong with just adding braces ?
- if (sdl || !vnc_display)
+ if (sdl || !vnc_display) {
#if defined(CONFIG_SDL)
sdl_display_init(ds, full_screen, no_frame);
#elif defined(CONFIG_COCOA)
cocoa_display_init(ds, full_screen); #endif
+ }
Ian.