# - COMPAT=/DWIN32S_COMPAT
# Generates a binary that works (minimally) with Win32s.
#
# - COMPAT=/DWIN32S_COMPAT
# Generates a binary that works (minimally) with Win32s.
#
+# - COMPAT=/DAUTO_WINSOCK
+# Causes PuTTY to assume that <windows.h> includes its own WinSock
+# header file, so that it won't try to include <winsock.h>.
+#
+# - COMPAT=/DWINSOCK_TWO
+# Causes the PuTTY utilities to include <winsock2.h> instead of
+# <winsock.h>, except Plink which _needs_ WinSock 2 so it already
+# does this.
+#
# - RCFL=/DASCIICTLS
# Uses ASCII rather than Unicode to specify the tab control in
# the resource file. Probably most useful when compiling with
# - RCFL=/DASCIICTLS
# Uses ASCII rather than Unicode to specify the tab control in
# the resource file. Probably most useful when compiling with
* PLink - a command-line (stdin/stdout) variant of PuTTY.
*/
* PLink - a command-line (stdin/stdout) variant of PuTTY.
*/
#include <windows.h>
#include <stdio.h>
#include <stdarg.h>
#include <windows.h>
#include <stdio.h>
#include <stdarg.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
#include "putty.h"
#include "tree234.h"
#include "putty.h"
#include "tree234.h"
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
#include <windows.h>
#include <commctrl.h>
#include <commdlg.h>
#include <windows.h>
#include <commctrl.h>
#include <commdlg.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <commctrl.h>
#include <windows.h>
#include <commctrl.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>