Skip to contentSkip to conversation

Fix a compile error when none of the definesis hit

PATCH [email protected] 2 participants 2 messages Jan 21, 2009

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines
Quoted 2 lines · Liu Yu

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
index 63d954b..1bf13c0 100644
@@ -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

#1 lore raw

[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.