]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Enable better build-time flexibility over which WinSock to include
authorSimon Tatham <anakin@pobox.com>
Fri, 22 Sep 2000 13:16:49 +0000 (13:16 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 22 Sep 2000 13:16:49 +0000 (13:16 +0000)
[originally from svn r615]

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

index 37d881e7d44aeaffe77c7f8d12a2e83cb2e38d2a..134193074d2dcb5b0ac4873745d4a177c7d5d27c 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 db48d5441cfe8858a4003ad491d20255a51c08d6..0a740622769fef0910e10c2eebc4e7ecbe9c5b99 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 f7df52cb686c7f834856804da4b82f2a036636e3..cf6d04f8f5e6cc79edf72f51264e626396dc4f14 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 7466e433cf010f1f077295acc049800607b98970..8c7df21aafff4eb69811b3a820a75f8ec4521fd5 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 3cfab6069a9305116a3089b387d571b2b469563c..97c6839b05547145c9d6757bdcc2ab9669fbdc0a 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 5e6ba3c2aa1c378e1f7c7af60d42c3d2227a6e4b..6618fdf8476e19ef521a3346abe40a6004e0541c 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 ca8691414df76ccc6238da895cf5d85b7a1e1ac5..77db051248febaee5912ac07217583994158fe6c 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 be4b4e8dace0a47cc1d5aacd9c96428151f6ce3d..9c973faf401b702e7aa74329bc11ea8efa5f46c9 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>