https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=57c3ca8d51cdf1e9fcf10588c9519fb7b9dcf7e1

commit 57c3ca8d51cdf1e9fcf10588c9519fb7b9dcf7e1
Author: Corinna Vinschen <[email protected]>
Date:   Wed Aug 3 15:53:41 2022 +0200

    Cygwin: drop macro and code for 
CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES
    
    Signed-off-by: Corinna Vinschen <[email protected]>

Diff:
---
 winsup/cygwin/fhandler_socket_inet.cc  | 27 ---------------------------
 winsup/cygwin/include/cygwin/version.h |  3 ---
 2 files changed, 30 deletions(-)

diff --git a/winsup/cygwin/fhandler_socket_inet.cc 
b/winsup/cygwin/fhandler_socket_inet.cc
index a4077e4ec..63cc498f1 100644
--- a/winsup/cygwin/fhandler_socket_inet.cc
+++ b/winsup/cygwin/fhandler_socket_inet.cc
@@ -177,27 +177,6 @@ get_ext_funcptr (SOCKET sock, void *funcptr)
                   &bret, NULL, NULL);
 }
 
-static int
-convert_ws1_ip_optname (int optname)
-{
-  static int ws2_optname[] =
-  {
-    0,
-    IP_OPTIONS,
-    IP_MULTICAST_IF,
-    IP_MULTICAST_TTL,
-    IP_MULTICAST_LOOP,
-    IP_ADD_MEMBERSHIP,
-    IP_DROP_MEMBERSHIP,
-    IP_TTL,
-    IP_TOS,
-    IP_DONTFRAGMENT
-  };
-  return (optname < 1 || optname > _WS1_IP_DONTFRAGMENT)
-        ? optname
-        : ws2_optname[optname];
-}
-
 fhandler_socket_wsock::fhandler_socket_wsock () :
   fhandler_socket (),
   wsock_events (NULL),
@@ -1832,9 +1811,6 @@ fhandler_socket_inet::setsockopt (int level, int optname, 
const void *optval,
       break;
 
     case IPPROTO_IP:
-      /* Old applications still use the old WinSock1 IPPROTO_IP values. */
-      if (CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES)
-       optname = convert_ws1_ip_optname (optname);
       switch (optname)
        {
        case IP_TOS:
@@ -2158,9 +2134,6 @@ fhandler_socket_inet::getsockopt (int level, int optname, 
const void *optval,
       break;
 
     case IPPROTO_IP:
-      /* Old applications still use the old WinSock1 IPPROTO_IP values. */
-      if (CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES)
-       optname = convert_ws1_ip_optname (optname);
       break;
 
     case IPPROTO_TCP:
diff --git a/winsup/cygwin/include/cygwin/version.h 
b/winsup/cygwin/include/cygwin/version.h
index befc006bb..83f8c34f6 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -34,9 +34,6 @@ details. */
 #define CYGWIN_VERSION_USER_API_VERSION_COMBINED \
   CYGWIN_VERSION_PER_PROCESS_API_VERSION_COMBINED (user_data)
 
-#define CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES \
-  (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 138)
-
 #define CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ \
   (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 161)

Reply via email to