]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.2052: win32: using deprecated wsock32 api v9.0.2052
authorKen Takata <kentkt@csc.jp>
Thu, 19 Oct 2023 15:22:24 +0000 (17:22 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 19 Oct 2023 15:24:02 +0000 (17:24 +0200)
Problem:  win32: using deprecated wsock32 api
Solution: Use winsock2 (ws2_32) consistently

win32: Stop using wsock32

We have already used ws2_32 (winsock2) and already dropped support for
Windows 95 and NT4.  So, we don't need to care about wsock32.

Use ws2_32 consistently.

closes: #13383

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
src/Make_cyg_ming.mak
src/Make_mvc.mak
src/channel.c
src/if_perl.xs
src/os_win32.h
src/version.c

index 236308025906e666068d9c905d8918e13af5c9f7..7afb6e03cebd63ddf7582bc102fa578645ef4b4a 100644 (file)
@@ -923,7 +923,7 @@ endif
 
 ifeq ($(CHANNEL),yes)
 OBJ += $(OUTDIR)/job.o $(OUTDIR)/channel.o
-LIB += -lwsock32 -lws2_32
+LIB += -lws2_32
 endif
 
 ifeq ($(DIRECTX),yes)
index 618821d690c5a3c45ea28ed2df4df6c1b478f048..5573a585f9ec937ccbc8712bdd36ff97c2e90c79 100644 (file)
@@ -420,7 +420,6 @@ NBDEBUG_DEFS        = -DNBDEBUG
 NBDEBUG_INCL   = nbdebug.h
 NBDEBUG_SRC    = nbdebug.c
 !  endif
-NETBEANS_LIB   = WSock32.lib
 ! endif
 
 # DirectWrite (DirectX)
@@ -473,7 +472,7 @@ CHANNEL_PRO = proto/job.pro proto/channel.pro
 CHANNEL_OBJ    = $(OBJDIR)/job.obj $(OBJDIR)/channel.obj
 CHANNEL_DEFS   = -DFEAT_JOB_CHANNEL -DFEAT_IPV6 -DHAVE_INET_NTOP
 
-NETBEANS_LIB   = WSock32.lib Ws2_32.lib
+NETBEANS_LIB   = Ws2_32.lib
 !endif
 
 # need advapi32.lib for GetUserName()
index 38f610a9fbcbf3aa4da1cafe2a0954c563ede4c3..8d850c656f1d50d0e5046742c8fc6edc09f3b8a3 100644 (file)
  * Implements communication through a socket or any file handle.
  */
 
-#ifdef WIN32
-// Must include winsock2.h before windows.h since it conflicts with winsock.h
-// (included in windows.h).
-# include <winsock2.h>
-# include <ws2tcpip.h>
-#endif
-
 #include "vim.h"
 
 #if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
index d88c3f3d99cbea6d0f2149fe74c1069096fe2453..dd504d384b28a0de00ec84fecf73ba5c360b8eac 100644 (file)
 # define _USE_32BIT_TIME_T
 #endif
 
-/*
- * Prevent including winsock.h.  perl.h tries to detect whether winsock.h is
- * already included before including winsock2.h, because winsock2.h isn't
- * compatible with winsock.h.  However the detection doesn't work with some
- * versions of MinGW.  If WIN32_LEAN_AND_MEAN is defined, windows.h will not
- * include winsock.h.
- */
-#ifdef WIN32
-# define WIN32_LEAN_AND_MEAN
-#endif
-
 #include "vim.h"
 
 #ifdef _MSC_VER
index 87555b7896579c02c24cc3201b953d4994ed91e6..5995e70af294932e3f4a2ddd24f2654533457cae 100644 (file)
 # define COBJMACROS    // For OLE: Enable "friendlier" access to objects
 #endif
 #ifndef PROTO
+// Must include winsock2.h before windows.h since it conflicts with winsock.h
+// (included in windows.h).
+# include <winsock2.h>
+# include <ws2tcpip.h>
 # include <windows.h>
 
 // Weird: rpcndr.h defines "small" to "char", which causes trouble
index 87ed0b23bfc832ae10e1cf4c66cf7186e421bdea..34eb37a5f38ee1e78177b82d61c36a8d72b9f852 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2052,
 /**/
     2051,
 /**/