Miscellaneous fixes to try to make other compilers happier
[u/mdw/putty] / misc.c
diff --git a/misc.c b/misc.c
index 370eea0..e06ced6 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,11 @@
 #include <windows.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
+#include <winsock.h>
+#endif
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include "putty.h"
 static FILE *fp = NULL;
 
 void mlog(char *file, int line) {
-    if (!fp)
+    if (!fp) {
        fp = fopen("putty_mem.log", "w");
+       setvbuf(fp, NULL, _IONBF, BUFSIZ);
+    }
     if (fp)
        fprintf (fp, "%s:%d: ", file, line);
 }