qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Win32 stdio not working if SDL is enabled
@ 2015-08-13 12:06 Daniel P. Berrange
  2015-08-13 12:14 ` Pavel Fedin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Daniel P. Berrange @ 2015-08-13 12:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil

When debugging some patches on Windows, I discovered that nothing printed
to stderr ever appears on the console. Eventually I discovered that if I
build with --disable-sdl, then stderr appears just fine.

Looking at the code in vl.c I see a hack for SDL introduced in

  commit 59a36a2f6728081050afc6ec97d0018467999f79
  Author: Stefan Weil <weil@mail.berlios.de>
  Date:   Thu Jun 18 20:11:03 2009 +0200

    Win32: Fix compilation with SDL.


If I mostly kill the hack from vl.c, and just leave a plain '#undef main'
then I get working console stderr once again.

eg I applied

diff --git a/vl.c b/vl.c
index 0adbbd6..8e1481b 100644
--- a/vl.c
+++ b/vl.c
@@ -39,16 +39,8 @@
 #endif
 
 #ifdef CONFIG_SDL
-#if defined(__APPLE__) || defined(main)
 #include <SDL.h>
-int qemu_main(int argc, char **argv, char **envp);
-int main(int argc, char **argv)
-{
-    return qemu_main(argc, argv, NULL);
-}
 #undef main
-#define main qemu_main
-#endif
 #endif /* CONFIG_SDL */
 
 #ifdef CONFIG_COCOA


FWIW, I'm building on Fedora 22 using


 # ./configure --cross-prefix=i686-w64-mingw32- \
           --prefix=$HOME/usr/qemu-git-win32 \
	   --target-list=x86_64-softmmu \
	   --disable-libusb --disable-usb-redir

Which has

  mingw32-SDL-1.2.15-5.fc21.noarch


To test I just run

  C:> qemu-system-x86_64 -object foobar
  qemu-system-x86_64: -object foobar: Parameter 'id' is missing

to get it to print an error about bad -object arg. The message
never appears unless I apply that patch above, though I lack any
explanation as to why this is happening, aside from "SDL black magic"

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-08-14 14:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-13 12:06 [Qemu-devel] Win32 stdio not working if SDL is enabled Daniel P. Berrange
2015-08-13 12:14 ` Pavel Fedin
2015-08-13 14:18 ` Daniel P. Berrange
2015-08-13 17:48 ` Stefan Weil
2015-08-14 11:14   ` Daniel P. Berrange
2015-08-14 12:15     ` Daniel P. Berrange
2015-08-14 14:59       ` Liviu Ionescu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).