diff --git a/liboio-test.vcxproj b/liboio-test.vcxproj
index 5557dd30..ec48b3ee 100644
--- a/liboio-test.vcxproj
+++ b/liboio-test.vcxproj
@@ -141,13 +141,13 @@
-
+
-
+
diff --git a/oio-win.c b/oio-win.c
index 449866c4..61b6cc9d 100644
--- a/oio-win.c
+++ b/oio-win.c
@@ -642,7 +642,6 @@ int oio_read(oio_req *req, oio_buf* bufs, int bufcnt) {
int oio_write2(oio_req *req, const char* msg) {
oio_buf buf;
- oio_handle* handle = req->handle;
buf.base = (char*)msg;
buf.len = strlen(msg);
diff --git a/oio-win.h b/oio-win.h
index 84293013..9f252246 100644
--- a/oio-win.h
+++ b/oio-win.h
@@ -1,4 +1,8 @@
+#ifndef _WIN32_WINNT
+# define _WIN32_WINNT 0x0501
+#endif
+
#include
#include
#include
diff --git a/test/runner-win32.c b/test/runner-win.c
similarity index 92%
rename from test/runner-win32.c
rename to test/runner-win.c
index 9beff17c..2b3134bb 100644
--- a/test/runner-win32.c
+++ b/test/runner-win.c
@@ -6,9 +6,13 @@
#include "test.h"
#include "runner.h"
-/* MinGW lacks a definition for _TRUNCATE. */
-#ifndef _TRUNCATE
-# define _TRUNCATE ((size_t)-1)
+
+/*
+ * Define the stuff that MinGW doesn't have
+ */
+#ifndef GetFileSizeEx
+ WINBASEAPI BOOL WINAPI GetFileSizeEx(HANDLE hFile,
+ PLARGE_INTEGER lpFileSize);
#endif
@@ -57,12 +61,11 @@ int process_start(char *name, process_info_t *p) {
if (result == 0 || result == sizeof(image))
goto error;
- if (_snwprintf_s((wchar_t*)&args,
- sizeof(args) / sizeof(wchar_t),
- _TRUNCATE,
- L"\"%s\" %S",
- image,
- name) < 0)
+ if (_snwprintf((wchar_t*)&args,
+ sizeof(args) / sizeof(wchar_t),
+ L"\"%s\" %S",
+ image,
+ name) < 0)
goto error;
memset((void*)&si, 0, sizeof(si));
diff --git a/test/runner-win32.h b/test/runner-win.h
similarity index 100%
rename from test/runner-win32.h
rename to test/runner-win.h
diff --git a/test/runner.h b/test/runner.h
index 56ab1571..57bb1349 100644
--- a/test/runner.h
+++ b/test/runner.h
@@ -37,7 +37,7 @@ typedef struct {
* Include platform-dependent definitions
*/
#ifdef _WIN32
-# include "runner-win32.h"
+# include "runner-win.h"
#else
# include "runner-unix.h"
#endif