From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LgLow-00088u-TA for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:25:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LgLov-00087r-A5 for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:25:46 -0400 Received: from [199.232.76.173] (port=43596 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgLov-00087g-2y for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:25:45 -0400 Received: from yw-out-1718.google.com ([74.125.46.153]:12805) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LgLou-0002kf-J6 for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:25:44 -0400 Received: by yw-out-1718.google.com with SMTP id 6so529333ywa.82 for ; Sun, 08 Mar 2009 09:25:44 -0700 (PDT) Message-ID: <49B3F185.6070706@codemonkey.ws> Date: Sun, 08 Mar 2009 11:25:41 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [6736] Sparse fixes: NULL use, header order, ANSI prototypes, static References: <49B3E265.1040205@codemonkey.ws> <49B3EF58.701@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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: Blue Swirl Cc: qemu-devel@nongnu.org Blue Swirl wrote: > On 3/8/09, Anthony Liguori wrote: > >> 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. > I'm about to commit #3. I think doing the #defines in a header file is wrong and broken. I see a large numbers of places in the tree right now that do it and it results in extra warnings. Using -D simplifies things and reduces warnings. Then adding #include where needed becomes pretty clean. Regards, Anthony Liguori