qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: kwolf@redhat.com, peter.maydell@linaro.org,
	"Anthony Liguori" <aliguori@amazon.com>,
	qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v2 4/5] w32: Replace Windows specific data types in common header files
Date: Mon, 10 Mar 2014 16:17:13 +0100	[thread overview]
Message-ID: <20140310151713.GD32400@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1394230667-17037-5-git-send-email-sw@weilnetz.de>

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 <windows.h>.  Still, I would leave this
one out.

Stefan

  reply	other threads:[~2014-03-10 15:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07 22:17 [Qemu-devel] [PATCH v2 0/5] w32: Reduce dependency on Windows API Stefan Weil
2014-03-07 22:17 ` [Qemu-devel] [PATCH v2 1/5] w32: Add and use intermediate include file for windows.h Stefan Weil
2014-03-10  8:56   ` Markus Armbruster
2014-03-10 17:38     ` Stefan Weil
2014-03-07 22:17 ` [Qemu-devel] [PATCH v2 2/5] w32: Move inline function from header file to C source Stefan Weil
2014-03-07 22:17 ` [Qemu-devel] [PATCH v2 3/5] w32: Reduce dependencies in sysemu/os-win32.h Stefan Weil
2014-03-07 22:17 ` [Qemu-devel] [PATCH v2 4/5] w32: Replace Windows specific data types in common header files Stefan Weil
2014-03-10 15:17   ` Stefan Hajnoczi [this message]
2014-03-10 18:34     ` Stefan Weil
2014-03-11  7:51       ` Stefan Hajnoczi
2014-03-11  8:06       ` Paolo Bonzini
2014-03-07 22:17 ` [Qemu-devel] [PATCH v2 5/5] block: Review include statements for winioctl.h Stefan Weil
2014-03-10 15:18 ` [Qemu-devel] [PATCH v2 0/5] w32: Reduce dependency on Windows API Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140310151713.GD32400@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).