From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58610 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKUJY-0001Id-KM for qemu-devel@nongnu.org; Fri, 04 Jun 2010 06:39:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKUJX-0002XA-JW for qemu-devel@nongnu.org; Fri, 04 Jun 2010 06:39:48 -0400 Received: from mail-ww0-f45.google.com ([74.125.82.45]:54248) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKUJX-0002X5-EM for qemu-devel@nongnu.org; Fri, 04 Jun 2010 06:39:47 -0400 Received: by wwb13 with SMTP id 13so812041wwb.4 for ; Fri, 04 Jun 2010 03:39:46 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4C08D7EF.4000008@redhat.com> Date: Fri, 04 Jun 2010 12:39:43 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1275583692-11678-1-git-send-email-Jes.Sorensen@redhat.com> <1275583692-11678-11-git-send-email-Jes.Sorensen@redhat.com> <4C08B797.7060702@redhat.com> In-Reply-To: <4C08B797.7060702@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 10/16] Introduce OS specific cmdline argument handling and move SMB arg to os-posix.c List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes Sorensen Cc: Markus Armbruster , qemu-devel@nongnu.org >>> +/* >>> + * Duplicate definition from vl.c to avoid messing up the entire build >>> + */ >>> +enum { >>> +#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ >>> + opt_enum, >>> +#define DEFHEADING(text) >>> +#include "qemu-options.h" >>> +#undef DEF >>> +#undef DEFHEADING >>> +#undef GEN_DOCS >>> +}; >> >> I agree with Richard: this is gross. > > The enum creation is gross by itself. Only way to get around not > duplicating it is to create a new header file to hold just that? I don't think it's particularly gross. At least you don't have two files to keep in sync. You could rename qemu-options.h to qemu-options.def, and make a real header file with the typedef and the enum. Then include the header from vl.c and os-*.c. BTW from Fedora 11 and newer you can easily build QEMU with a cross compiler. (Running it is a bit harder). These packages should suffice: mingw32-w32api mingw32-cpp mingw32-termcap mingw32-runtime mingw32-binutils mingw32-filesystem mingw32-SDL mingw32-gcc mingw32-zlib and you need to configure it with "--cross-prefix=i686-pc-mingw32-" (trailing dash included!). Paolo