[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 1/8] qga: fixed warning in qemu-ga.exe for mingw

From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 1/8] qga: fixed warning in qemu-ga.exe for mingw >= 4.9.1
Date: Tue, 03 Feb 2015 14:29:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 12/31/2014 06:06 AM, Denis V. Lunev wrote:
> From: Olga Krishtal <address@hidden>
> strtok_r was redefined before the patch
> Signed-off-by: Olga Krishtal <address@hidden>
> Signed-off-by: Denis V. Lunev <address@hidden>
> CC: Michael Roth <address@hidden>
> ---
>  include/sysemu/os-win32.h | 2 ++
>  1 file changed, 2 insertions(+)

What's the actual compiler error you get without this patch?

> diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
> index af3fbc4..84e229b 100644
> --- a/include/sysemu/os-win32.h
> +++ b/include/sysemu/os-win32.h
> @@ -81,7 +81,9 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result);
>  #undef localtime_r
>  struct tm *localtime_r(const time_t *timep, struct tm *result);
> +#if defined __MINGW32__ && !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 9)
>  char *strtok_r(char *str, const char *delim, char **saveptr);

It feels weird to key off of the gcc version.  Whether strtok_r is
defined is a property of the system headers, not the compiler.  For
example, I'm aware a but where older mingw <pthreads.h> would pollute
the namespace with a broken #define of strtok_r; but that has been fixed
in newer mingw headers (on Fedora, I know that F20 mingw has the bug,
F21 does not).  But that is the version of mingw, not the version of
gcc, that determined that problem.  Therefore, I'm not sure this is the
right patch, but without knowing the symptoms it fixes, I don't know if
anything is better.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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