[Spice-devel] [PATCH 2/8] common: add windows.h where required, make gdi_handlers static

Marc-André Lureau marcandre.lureau at redhat.com
Tue May 3 07:37:39 PDT 2011


This patch has not been verified with VS/brew. It should be safe
hopefully. Compilation is fine with mingw32/spice-gtk.
---
 client/windows/platform.cpp |    1 -
 common/canvas_base.h        |    3 +++
 common/canvas_utils.c       |    2 +-
 common/canvas_utils.h       |    4 ++++
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/client/windows/platform.cpp b/client/windows/platform.cpp
index c50d7fd..b81c2f5 100644
--- a/client/windows/platform.cpp
+++ b/client/windows/platform.cpp
@@ -45,7 +45,6 @@
 #endif
 #include <spice/vd_agent.h>
 
-int gdi_handlers = 0;
 extern HINSTANCE instance;
 
 class DefaultEventListener: public Platform::EventListener {
diff --git a/common/canvas_base.h b/common/canvas_base.h
index 7c5f275..7a69def 100644
--- a/common/canvas_base.h
+++ b/common/canvas_base.h
@@ -27,6 +27,9 @@
 #include "lz.h"
 #include "region.h"
 #include "draw.h"
+#ifdef WIN32
+#include <windows.h>
+#endif
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index d861800..604f589 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -30,7 +30,7 @@
 #include "mem.h"
 
 #ifdef WIN32
-extern int gdi_handlers;
+static int gdi_handlers = 0;
 #endif
 
 #ifndef CANVAS_ERROR
diff --git a/common/canvas_utils.h b/common/canvas_utils.h
index ffed927..16ada45 100644
--- a/common/canvas_utils.h
+++ b/common/canvas_utils.h
@@ -19,6 +19,10 @@
 #ifndef _H_CANVAS_UTILS
 #define _H_CANVAS_UTILS
 
+#ifdef WIN32
+#include <windows.h>
+#endif
+
 #include <spice/types.h>
 
 #include "pixman_utils.h"
-- 
1.7.4



More information about the Spice-devel mailing list