summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-07-08 11:40:57 +0200
committerAlon Levy <alevy@redhat.com>2010-12-08 17:11:45 +0200
commitf6cacd0e51d345e1ee8b82e420c59dfaaf95300a (patch)
tree1529fa71ed90955fcbfaa5b8e47c8b77dbdfc008
parent53c808947d4d5b480d8880f69b53d4e6bac056fa (diff)
downloadspice-f6cacd0e51d345e1ee8b82e420c59dfaaf95300a.tar.gz
spice-f6cacd0e51d345e1ee8b82e420c59dfaaf95300a.tar.xz
spice-f6cacd0e51d345e1ee8b82e420c59dfaaf95300a.zip
mingw32 build: fix build errors
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--client/common.h10
-rw-r--r--client/windows/platform_utils.h3
-rw-r--r--client/zlib_decoder.h4
-rw-r--r--common/gdi_canvas.c4
4 files changed, 17 insertions, 4 deletions
diff --git a/client/common.h b/client/common.h
index c3be6568..bda7a191 100644
--- a/client/common.h
+++ b/client/common.h
@@ -37,6 +37,16 @@
#include <string.h>
#ifdef WIN32
+#ifdef __GNUC__
+#define UNICODE 1
+#define _UNICODE 1
+#define WINVER 0x0501
+#define swprintf_s(_str, _len, _fmt, ...) \
+ swprintf(_str, _fmt, ## __VA_ARGS__)
+#define vsnprintf_s(_str, _len1, _len2, _fmt, _valist) \
+ vsnprintf(_str, _len2, _fmt, _valist)
+#define _ftime_s(_t) _ftime(_t)
+#endif
#include <winsock2.h>
#include <windows.h>
diff --git a/client/windows/platform_utils.h b/client/windows/platform_utils.h
index 49f9d39d..2f333f70 100644
--- a/client/windows/platform_utils.h
+++ b/client/windows/platform_utils.h
@@ -21,10 +21,11 @@
#include <winsock.h>
#include <winsock2.h>
#include <ws2tcpip.h>
+#include "utils.h"
#define mb() __asm {lock add [esp], 0}
-template<class T, class FreeRes = FreeObject<T>, T invalid = NULL >
+template<class T, class FreeRes = FreeObject<T>, intptr_t invalid = 0 >
class AutoRes {
public:
AutoRes() : res(invalid) {}
diff --git a/client/zlib_decoder.h b/client/zlib_decoder.h
index 84b6f836..44440402 100644
--- a/client/zlib_decoder.h
+++ b/client/zlib_decoder.h
@@ -22,7 +22,9 @@
#include "common.h"
#include "canvas_base.h"
-#define ZLIB_WINAPI
+#ifndef __GNUC__
+#define ZLIB_WINAPI
+#endif
#include <zlib.h>
diff --git a/common/gdi_canvas.c b/common/gdi_canvas.c
index eda1529c..705a0402 100644
--- a/common/gdi_canvas.c
+++ b/common/gdi_canvas.c
@@ -16,8 +16,8 @@
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <Windows.h>
-#include <Wingdi.h>
+#include <windows.h>
+#include <wingdi.h>
#include "gdi_canvas.h"
#define GDI_CANVAS
#include "canvas_base.c"