Enable better build-time flexibility over which WinSock to include
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 22 Sep 2000 13:16:49 +0000 (13:16 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 22 Sep 2000 13:16:49 +0000 (13:16 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@615 cda61777-01e9-0310-a592-d414129be87e

Makefile
plink.c
raw.c
scp.c
ssh.c
telnet.c
windlg.c
window.c

index 37d881e..1341930 100644 (file)
--- a/Makefile
+++ b/Makefile
 #  - 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
diff --git a/plink.c b/plink.c
index db48d54..0a74062 100644 (file)
--- a/plink.c
+++ b/plink.c
@@ -2,7 +2,9 @@
  * PLink - a command-line (stdin/stdout) variant of PuTTY.
  */
 
+#ifndef AUTO_WINSOCK
 #include <winsock2.h>
+#endif
 #include <windows.h>
 #include <stdio.h>
 #include <stdarg.h>
diff --git a/raw.c b/raw.c
index f7df52c..cf6d04f 100644 (file)
--- a/raw.c
+++ b/raw.c
@@ -1,7 +1,13 @@
 #include <windows.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
 #include <winsock.h>
+#endif
+#endif
 
 #include "putty.h"
 
diff --git a/scp.c b/scp.c
index 7466e43..8c7df21 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -9,7 +9,13 @@
  */
 
 #include <windows.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
 #include <winsock.h>
+#endif
+#endif
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/ssh.c b/ssh.c
index 3cfab60..97c6839 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -2,7 +2,13 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <assert.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
 #include <winsock.h>
+#endif
+#endif
 
 #include "putty.h"
 #include "tree234.h"
index 5e6ba3c..6618fdf 100644 (file)
--- a/telnet.c
+++ b/telnet.c
@@ -1,7 +1,13 @@
 #include <windows.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
 #include <winsock.h>
+#endif
+#endif
 
 #include "putty.h"
 
index ca86914..77db051 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -1,7 +1,13 @@
 #include <windows.h>
 #include <commctrl.h>
 #include <commdlg.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
 #include <winsock.h>
+#endif
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 
index be4b4e8..9c973fa 100644 (file)
--- a/window.c
+++ b/window.c
@@ -1,6 +1,12 @@
 #include <windows.h>
 #include <commctrl.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
 #include <winsock.h>
+#endif
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>