All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>,
	"qemu-trivial@nongnu.org" <qemu-trivial@nongnu.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-trivial] [PATCH repost] gtk: avoid redefining _WIN32_WINNT macro
Date: Tue, 8 Sep 2015 11:35:15 +0200	[thread overview]
Message-ID: <55EEABD3.2090903@redhat.com> (raw)
In-Reply-To: <1441704488-9512-1-git-send-email-berrange@redhat.com>



On 08/09/2015 11:28, Daniel P. Berrange wrote:
> In file included from ui/gtk.c:40:0:
> include/ui/gtk.h:5:0: warning: "_WIN32_WINNT" redefined
>  # define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */
>   ^
> In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/crtdefs.h:10:0,
>                  from /usr/i686-w64-mingw32/sys-root/mingw/include/stdio.h:9,
>                  from /home/berrange/src/virt/qemu/include/qemu/fprintf-fn.h:12,
>                  from /home/berrange/src/virt/qemu/include/qemu-common.h:18,
>                  from ui/gtk.c:37:
> /usr/i686-w64-mingw32/sys-root/mingw/include/_mingw.h:225:0: note: this is the location of the previous definition
>  #define _WIN32_WINNT 0x502
>  ^
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  include/ui/gtk.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/ui/gtk.h b/include/ui/gtk.h
> index ee6dffd..7796231 100644
> --- a/include/ui/gtk.h
> +++ b/include/ui/gtk.h
> @@ -2,7 +2,9 @@
>  #define UI_GTK_H
>  
>  #ifdef _WIN32
> -# define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */
> +# ifndef _WIN32_WINNT
> +#  define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */
> +# endif
>  #endif

Your error message shows that _WIN32_WINNT was 0x0502, do you get
MAPVK_VK_TO_VSC with this patch?

Perhaps #undef the macro first, or do something like:

#if !defined _WIN32_WINNT || _WIN32_WINNT < 0x0601
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0601
#endif

Paolo


WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>,
	"qemu-trivial@nongnu.org" <qemu-trivial@nongnu.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH repost] gtk: avoid redefining _WIN32_WINNT macro
Date: Tue, 8 Sep 2015 11:35:15 +0200	[thread overview]
Message-ID: <55EEABD3.2090903@redhat.com> (raw)
In-Reply-To: <1441704488-9512-1-git-send-email-berrange@redhat.com>



On 08/09/2015 11:28, Daniel P. Berrange wrote:
> In file included from ui/gtk.c:40:0:
> include/ui/gtk.h:5:0: warning: "_WIN32_WINNT" redefined
>  # define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */
>   ^
> In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/crtdefs.h:10:0,
>                  from /usr/i686-w64-mingw32/sys-root/mingw/include/stdio.h:9,
>                  from /home/berrange/src/virt/qemu/include/qemu/fprintf-fn.h:12,
>                  from /home/berrange/src/virt/qemu/include/qemu-common.h:18,
>                  from ui/gtk.c:37:
> /usr/i686-w64-mingw32/sys-root/mingw/include/_mingw.h:225:0: note: this is the location of the previous definition
>  #define _WIN32_WINNT 0x502
>  ^
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  include/ui/gtk.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/ui/gtk.h b/include/ui/gtk.h
> index ee6dffd..7796231 100644
> --- a/include/ui/gtk.h
> +++ b/include/ui/gtk.h
> @@ -2,7 +2,9 @@
>  #define UI_GTK_H
>  
>  #ifdef _WIN32
> -# define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */
> +# ifndef _WIN32_WINNT
> +#  define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */
> +# endif
>  #endif

Your error message shows that _WIN32_WINNT was 0x0502, do you get
MAPVK_VK_TO_VSC with this patch?

Perhaps #undef the macro first, or do something like:

#if !defined _WIN32_WINNT || _WIN32_WINNT < 0x0601
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0601
#endif

Paolo

  reply	other threads:[~2015-09-08  9:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08  9:28 [Qemu-trivial] [PATCH repost] gtk: avoid redefining _WIN32_WINNT macro Daniel P. Berrange
2015-09-08  9:28 ` [Qemu-devel] " Daniel P. Berrange
2015-09-08  9:35 ` Paolo Bonzini [this message]
2015-09-08  9:35   ` Paolo Bonzini
2015-09-08 10:19   ` [Qemu-trivial] " Daniel P. Berrange
2015-09-08 10:19     ` [Qemu-devel] " Daniel P. Berrange

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=55EEABD3.2090903@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.