#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);
}