qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 4/5] w32: Replace Windows specific data types


From: Stefan Hajnoczi
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
User-agent: Mutt/1.5.21 (2010-09-15)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]