From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J2Yb3-000630-Jk for qemu-devel@nongnu.org; Wed, 12 Dec 2007 15:54:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J2Yaz-000613-Qu for qemu-devel@nongnu.org; Wed, 12 Dec 2007 15:54:24 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2Yaz-00060t-KS for qemu-devel@nongnu.org; Wed, 12 Dec 2007 15:54:21 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J2Yaz-0004HM-1u for qemu-devel@nongnu.org; Wed, 12 Dec 2007 15:54:21 -0500 Message-ID: <47604A79.1010804@mail.berlios.de> Date: Wed, 12 Dec 2007 21:54:17 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] Windows build broken References: <802848.87427.qm@web57002.mail.re3.yahoo.com> <83a4d4ca0712120241n77b602a3v22990b2bb12ca4e2@mail.gmail.com> <83a4d4ca0712121150q6b7ec678yb64eb7a5f2dbb363@mail.gmail.com> In-Reply-To: <83a4d4ca0712121150q6b7ec678yb64eb7a5f2dbb363@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org basetyps.h is included by windows.h / rpc.h. QEMU does not need it, so you can avoid it like this: #define WIN32_LEAN_AND_MEAN #include WIN32_LEAN_AND_MEAN reduces the number of includes in windows.h and increases compilation speed. And you don't have to rename variables like interface :-) Regards, Stefan Eduardo Felipe schrieb: > > 2007/12/12, C.W. Betts >: > > Could you perhaps give a patch? I don't feel like going through > and changing every instance of BlockInterfaceType to something else. > > > Having a closer look I think the underlying problem is a name conflict > with a #define in Mingw's header file basetyps.h, so renaming > variables looks right to me. Patch attached. > > Regards, > > > > > ------------------------------------------------------------------------ > > > *** sysemu.h > --- sysemu.h > --- sysemu.h 2 Dec 2007 04:51:08 -0000 1.2 > +++ sysemu.h 12 Dec 2007 19:17:47 -0000 > @@ -122,7 +122,7 @@ > > typedef struct DriveInfo { > BlockDriverState *bdrv; > - BlockInterfaceType interface; > + BlockInterfaceType binterface; > int bus; > int unit; > } DriveInfo; > @@ -134,8 +134,8 @@ > int nb_drives; > DriveInfo drives_table[MAX_DRIVES+1]; > > -extern int drive_get_index(BlockInterfaceType interface, int bus, int > unit); > -extern int drive_get_max_bus(BlockInterfaceType interface); > +extern int drive_get_index(BlockInterfaceType binterface, int bus, > int unit); > +extern int drive_get_max_bus(BlockInterfaceType binterface); > > /* serial ports */ > > > *** vl.c > --- vl.c > --- vl.c 10 Dec 2007 20:00:10 -0000 1.378 > +++ vl.c 12 Dec 2007 19:17:09 -0000 > @@ -4811,14 +4811,14 @@ > return nb_drives_opt++; > } > > -int drive_get_index(BlockInterfaceType interface, int bus, int unit) > +int drive_get_index(BlockInterfaceType binterface, int bus, int unit) > { > int index; > > /* seek interface, bus and unit */ > > for (index = 0; index < nb_drives; index++) > - if (drives_table[index].interface == interface && > + if (drives_table[index].binterface == binterface && > drives_table[index].bus == bus && > drives_table[index].unit == unit) > return index; > @@ -4826,14 +4826,14 @@ > return -1; > } > > -int drive_get_max_bus(BlockInterfaceType interface) > +int drive_get_max_bus(BlockInterfaceType binterface) > { > int max_bus; > int index; > > max_bus = -1; > for (index = 0; index < nb_drives; index++) { > - if(drives_table[index].interface == interface && > + if(drives_table[index].binterface == binterface && > drives_table[index].bus > max_bus) > max_bus = drives_table[index].bus; > } > @@ -4846,7 +4846,7 @@ > char file[1024]; > char devname[128]; > const char *mediastr = ""; > - BlockInterfaceType interface; > + BlockInterfaceType binterface; > enum { MEDIA_DISK, MEDIA_CDROM } media; > int bus_id, unit_id; > int cyls, heads, secs, translation; > @@ -4875,11 +4875,11 @@ > !strcmp(machine->name, "SS-600MP") || > !strcmp(machine->name, "versatilepb") || > !strcmp(machine->name, "versatileab")) { > - interface = IF_SCSI; > + binterface = IF_SCSI; > max_devs = MAX_SCSI_DEVS; > strcpy(devname, "scsi"); > } else { > - interface = IF_IDE; > + binterface = IF_IDE; > max_devs = MAX_IDE_DEVS; > strcpy(devname, "ide"); > } > @@ -4906,22 +4906,22 @@ > if (get_param_value(buf, sizeof(buf), "if", str)) { > strncpy(devname, buf, sizeof(devname)); > if (!strcmp(buf, "ide")) { > - interface = IF_IDE; > + binterface = IF_IDE; > max_devs = MAX_IDE_DEVS; > } else if (!strcmp(buf, "scsi")) { > - interface = IF_SCSI; > + binterface = IF_SCSI; > max_devs = MAX_SCSI_DEVS; > } else if (!strcmp(buf, "floppy")) { > - interface = IF_FLOPPY; > + binterface = IF_FLOPPY; > max_devs = 0; > } else if (!strcmp(buf, "pflash")) { > - interface = IF_PFLASH; > + binterface = IF_PFLASH; > max_devs = 0; > } else if (!strcmp(buf, "mtd")) { > - interface = IF_MTD; > + binterface = IF_MTD; > max_devs = 0; > } else if (!strcmp(buf, "sd")) { > - interface = IF_SD; > + binterface = IF_SD; > max_devs = 0; > } else { > fprintf(stderr, "qemu: '%s' unsupported bus type '%s'\n", str, buf); > @@ -5036,7 +5036,7 @@ > > if (unit_id == -1) { > unit_id = 0; > - while (drive_get_index(interface, bus_id, unit_id) != -1) { > + while (drive_get_index(binterface, bus_id, unit_id) != -1) { > unit_id++; > if (max_devs && unit_id >= max_devs) { > unit_id -= max_devs; > @@ -5057,23 +5057,23 @@ > * ignore multiple definitions > */ > > - if (drive_get_index(interface, bus_id, unit_id) != -1) > + if (drive_get_index(binterface, bus_id, unit_id) != -1) > return 0; > > /* init */ > > - if (interface == IF_IDE || interface == IF_SCSI) > + if (binterface == IF_IDE || binterface == IF_SCSI) > mediastr = (media == MEDIA_CDROM) ? "-cd" : "-hd"; > snprintf(buf, sizeof(buf), max_devs ? "%1$s%4$i%2$s%3$i" : "%s%s%i", > devname, mediastr, unit_id, bus_id); > bdrv = bdrv_new(buf); > drives_table[nb_drives].bdrv = bdrv; > - drives_table[nb_drives].interface = interface; > + drives_table[nb_drives].binterface = binterface; > drives_table[nb_drives].bus = bus_id; > drives_table[nb_drives].unit = unit_id; > nb_drives++; > > - switch(interface) { > + switch(binterface) { > case IF_IDE: > case IF_SCSI: > switch(media) { >