qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Filip Navara <navaraf@reactos.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Errors compiling QEMU with Mingw
Date: Fri, 18 Jun 2004 18:42:13 +0200	[thread overview]
Message-ID: <40D31B65.6090503@reactos.com> (raw)
In-Reply-To: <LNEOLALJGBCDJJJHFENPCEGCCHAA.dean.payne@adsl.on.net>

[-- Attachment #1: Type: text/plain, Size: 2076 bytes --]

Hi!

I sent a patch for this few days ago. It's attached...

- Filip


Dean Payne wrote:

>Hi,
>
>I have tried to compile QEMU for windows from the latest CVS using the
>latest MingW and various tools. I basically followed the instructions
>outlined for compiling QEMU from
>http://www.h7.dion.ne.jp/~qemu-win/PortingTips-en.html. Although I can
>compile the source as given there, I have no luck with the latest from CVS.
>
>The first error I got was
>------------
>In file included from C:/dev/Dev-Cpp/include/windef.h:246,
>                 from C:/dev/Dev-Cpp/include/windows.h:48,
>                 from d:/sourceforge/qemu/vl.c:60:
>C:/dev/Dev-Cpp/include/winnt.h:97: parse error before numeric constant
>------------
>
>I chased it down and it appears that the file
>
>qemu\target-ppc\cpu.h
>
>has a define on line 346 :
>
>#define LP     SPR_ENCODE(1022)
>
>which conflicts with the typedef in winnt.h:
>
>typedef TCHAR *LPTCH,*PTSTR,*LPTSTR,*LP,*PTCHAR;
>
>Without knowing too much about the source I changed the #define LP to a
>different symbol (hoping that it was not used elsewhere) but encountered
>another error:
>-------------------------
>gcc  -o qemu-system-ppc.exe vl.o osdep.o block.o monitor.o pci.o ppc.o ide.o
>ne2000.o pckbd.o vga.o sb16.o dma.o oss.o mc146818rtc.o serial.o i8259.o
>i8254.o fdc.o m48t59.o ppc_prep.o ppc_chrp.o cuda.o adb.o sdl.o
>ibqemu.a  -lm -lwinmm -lws2_32 -liphlpapi -L/usr/local/lib -lmingw32 -lSDLma
>in -lSDL -mwindows
>libqemu.a(op_helper.o)(.text+0x12b4): In function `dump_state':
>d:/sourceforge/qemu/target-ppc/op_helper.c:471: undefined reference to
>`stdout'
>make[1]: *** [qemu-system-ppc.exe] Error 1
>make[1]: Leaving directory `/d/sourceforge/qemu/ppc-softmmu'
>--------------------------
>
>I am not sure whether that is due to me or simply something else. Am I going
>about this the right way and can anyone offer some tips?
>
>Cheers
>
>Dean
>
>
>
>
>_______________________________________________
>Qemu-devel mailing list
>Qemu-devel@nongnu.org
>http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
>
>  
>


[-- Attachment #2: qemu-ppc-mingw.diff --]
[-- Type: text/plain, Size: 1518 bytes --]

diff -u -r qemu/target-ppc/cpu.h qemu.wincopy/target-ppc/cpu.h
--- qemu/target-ppc/cpu.h	Wed Jun  2 20:54:28 2004
+++ qemu.wincopy/target-ppc/cpu.h	Tue Jun  8 20:19:10 2004
@@ -343,7 +343,8 @@
 #define THRM2  SPR_ENCODE(1021)
 #define THRM3  SPR_ENCODE(1022)
 #define SP     SPR_ENCODE(1021)
-#define LP     SPR_ENCODE(1022)
+/* Conflicts with Win32 API defininition on MinGW builds */
+/* #define LP     SPR_ENCODE(1022) */
 #define DABR_MASK 0xFFFFFFF8
 #define FPECR  SPR_ENCODE(1022)
 #define PIR    SPR_ENCODE(1023)
diff -u -r qemu/target-ppc/helper.c qemu.wincopy/target-ppc/helper.c
--- qemu/target-ppc/helper.c	Wed Jun  2 20:54:28 2004
+++ qemu.wincopy/target-ppc/helper.c	Tue Jun  8 20:29:02 2004
@@ -27,8 +27,6 @@
 //#define DEBUG_BATS
 //#define DEBUG_EXCEPTIONS
 
-extern FILE *stdout, *stderr;
-
 /*****************************************************************************/
 /* PPC MMU emulation */
 int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw,
diff -u -r qemu/target-ppc/op_helper.c qemu.wincopy/target-ppc/op_helper.c
--- qemu/target-ppc/op_helper.c	Wed Jun  2 20:54:30 2004
+++ qemu.wincopy/target-ppc/op_helper.c	Tue Jun  8 20:30:06 2004
@@ -464,7 +464,14 @@
 
 /*****************************************************************************/
 /* Special helpers for debug */
+#ifndef _WIN32
 extern FILE *stdout;
+#else
+struct FILE { int opaque; };
+extern FILE (*_imp___iob)[];
+#define _iob	(*_imp___iob)
+#define stdout	(&_iob[1])
+#endif
 
 void dump_state (void)
 {

  reply	other threads:[~2004-06-18 16:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-18 16:29 [Qemu-devel] Errors compiling QEMU with Mingw Dean Payne
2004-06-18 16:42 ` Filip Navara [this message]
     [not found] <200406181841.i5IIfZQa019337@treas.simtreas.ru>
2004-06-19  7:33 ` Vladimir N. Oleynik
  -- strict thread matches above, loose matches on Subject: below --
2004-06-19  8:15 Filip Navara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40D31B65.6090503@reactos.com \
    --to=navaraf@reactos.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).