--- a/Utils.c
+++ b/Utils.c
@@ -2,7 +2,22 @@
 
 /* these are generic support routines */
 
+#ifdef _MSC_VER
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <varargs.h>
+#include <direct.h>
+
+#define PATH_MAX 1024
+
+#define getcwd _getcwd
+
+#else
+
 #include <unistd.h>
+
+#endif
 
 void Write(char* fmt, ...) {
     va_list ap;
@@ -34,6 +49,7 @@
 void FatalError(char* fmt, ...) {
     va_list ap;
 
+    va_start(ap, fmt);
     WriteError(fmt, ap);
     exit(-1);
 }
@@ -67,7 +83,7 @@
     return self;
 }
 
-void PtrMap_delete(void*** self, void* deletefn) {
+void PtrMap_delete(void*** self, void (*deletefn)(void*) ) {
     if (self) {
 	int* mem = ((int*)self)-2;
 	if (*mem) {