From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN1xG-00063I-Lt for qemu-devel@nongnu.org; Mon, 10 Mar 2014 11:17:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WN1x7-0007J6-M8 for qemu-devel@nongnu.org; Mon, 10 Mar 2014 11:17:26 -0400 Received: from mail-ee0-x22d.google.com ([2a00:1450:4013:c00::22d]:45900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN1x7-0007Ih-Ey for qemu-devel@nongnu.org; Mon, 10 Mar 2014 11:17:17 -0400 Received: by mail-ee0-f45.google.com with SMTP id d17so3186239eek.4 for ; Mon, 10 Mar 2014 08:17:16 -0700 (PDT) Date: Mon, 10 Mar 2014 16:17:13 +0100 From: Stefan Hajnoczi Message-ID: <20140310151713.GD32400@stefanha-thinkpad.redhat.com> References: <1394230667-17037-1-git-send-email-sw@weilnetz.de> <1394230667-17037-5-git-send-email-sw@weilnetz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1394230667-17037-5-git-send-email-sw@weilnetz.de> Subject: Re: [Qemu-devel] [PATCH v2 4/5] w32: Replace Windows specific data types in common header files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: kwolf@redhat.com, peter.maydell@linaro.org, Anthony Liguori , qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, Andreas =?iso-8859-1?Q?F=E4rber?= On Fri, Mar 07, 2014 at 11:17:46PM +0100, Stefan Weil wrote: > diff --git a/include/qemu/thread-win32.h b/include/qemu/thread-win32.h > index 7ade61a..b8b8e61 100644 > --- a/include/qemu/thread-win32.h > +++ b/include/qemu/thread-win32.h > @@ -1,24 +1,35 @@ > #ifndef __QEMU_THREAD_WIN32_H > #define __QEMU_THREAD_WIN32_H 1 > -#include "qemu/winapi.h" > + > +/* WinCriticalSection is a substitute for CRITICAL_SECTION and > + * introduced here to avoid dependencies on windows.h. */ > + > +typedef struct { > + WinHandle DebugInfo; > + WinLong LockCount; > + WinLong RecursionCount; > + WinHandle OwningThread; > + WinHandle LockSemaphore; > + WinULong *SpinCount; > +} WinCriticalSection; This is taking it a bit far. Avoiding includes for the scalar types seems okay but duplicating struct definitions makes me wonder how far we'll go to reduce compile times. (Plus wouldn't we have the same kind of copyright/license issues that mingw and other projects need to be very careful about when reimplementing Windows headers?) I guess the problem is that qemu-thread.h is included in a lot of places and you wish to avoid including . Still, I would leave this one out. Stefan