From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LgLme-0006sE-Q2 for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:23:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LgLmc-0006rN-L4 for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:23:24 -0400 Received: from [199.232.76.173] (port=46635 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgLmc-0006rB-DQ for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:23:22 -0400 Received: from mail-bw0-f171.google.com ([209.85.218.171]:42008) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LgLmb-0002GH-O1 for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:23:22 -0400 Received: by bwz19 with SMTP id 19so887593bwz.34 for ; Sun, 08 Mar 2009 09:23:20 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <49B3EF58.701@codemonkey.ws> References: <49B3E265.1040205@codemonkey.ws> <49B3EF58.701@codemonkey.ws> Date: Sun, 8 Mar 2009 18:23:20 +0200 Message-ID: Subject: Re: [Qemu-devel] [6736] Sparse fixes: NULL use, header order, ANSI prototypes, static From: Blue Swirl Content-Type: text/plain; charset=UTF-8 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: Anthony Liguori Cc: qemu-devel@nongnu.org On 3/8/09, Anthony Liguori wrote: > Blue Swirl wrote: > > > Taking vl.c as an example, do you mean that even these headers: > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > before config-host.h line are now broken because of missing windows.h > > include? Or is it just some header below that? > > > > > > Just windows headers. For example, from net.c: > > > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > > > /* Needed early for HOST_BSD etc. */ > > #include "config-host.h" > > > > #ifndef _WIN32 > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #ifdef __NetBSD__ > > #include > > #endif > > #ifdef __linux__ > > #include > > #endif > > #include > > #include > > #include > > #include > > #ifdef HOST_BSD > > #include > > #if defined(__FreeBSD__) || defined(__DragonFly__) > > #include > > #else > > #include > > #endif > > #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__) > > #include > > #else > > #ifdef __linux__ > > #include > > #include > > #include > > > > /* For the benefit of older linux systems which don't supply it, > > we use a local copy of hpet.h. */ > > /* #include */ > > #include "hpet.h" > > > > #include > > #include > > #endif > > #ifdef __sun__ > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include // must come after ip.h > > #include > > #include > > #include > > #include > > #include > > #endif > > #endif > > #endif > > > > #if defined(__OpenBSD__) > > #include > > #endif > > > > #if defined(CONFIG_VDE) > > #include > > #endif > > > > #ifdef _WIN32 > > #include > > #include > > #include > > #define getopt_long_only getopt_long > > #define memalign(align, size) malloc(size) > > #endif > > > > mmsystem.h needs windows.h to be included first. We need to get that > include from qemu-common.h. I see three options: > > 1) include qemu-common.h at the top of every file as we were previously > 2) split out a qemu-win32.h or something like that that just contained the > windows headers included as we need them > 3) explicitly include and use -D CFLAGS to set things up as we > need it. > > I guess #3 looks the best to me. I'd go for 2) but make it qemu-host.h which hides all Win/Linux/BSD specific stuff, maybe with -D tuning.