]> sjero.net Git - wget/commitdiff
Remove some functions not needed anymore.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Fri, 7 May 2010 10:46:47 +0000 (12:46 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Fri, 7 May 2010 10:46:47 +0000 (12:46 +0200)
src/ChangeLog
src/mswindows.c
src/mswindows.h

index 83baa58f1c97f12e22199ba94d4fef43dcbcca4c..73658393c8174777cd3b324b5990013d68ae6532 100644 (file)
@@ -2,6 +2,17 @@
 
        * mswindows.h: Always include <winsock2.h> and <ws2tcpip.h>.  Do not
        include <winsock.h>.
+       [! INHIBIT_WRAP]: Remove macro's socket, bind, connect, accept, recv,
+       send, select, getsockname, getpeername, setsockopt, closesocket.
+       Remove wrapped_socket, wrapped_bind, wrapped_connect, wrapped_listen,
+       wrapped_accept, wrapped_recv, wrapped_send, wrapped_select,
+       wrapped_getsockname, wrapped_getpeername, wrapped_setsockopt,
+       wrapped_closesocket prototypes.
+
+       * mswindows.c:  Remove wrapped_socket, wrapped_bind, wrapped_connect,
+       wrapped_listen, wrapped_accept, wrapped_recv, wrapped_send,
+       wrapped_select, wrapped_getsockname, wrapped_getpeername,
+       wrapped_setsockopt, wrapped_closesocket functions.  Remove WRAP macro.
 
        * host.h [WINDOWS]: Include <winsock2.h> not <winsock.h>.
 
index f3ee0152be276f3e80016d47bdc68752919723f5..245cff3b7abc6bbb65e0a22821087e48cbaa3836 100644 (file)
@@ -571,37 +571,6 @@ run_with_timeout (double seconds, void (*fun) (void *), void *arg)
   thread_hnd = NULL;
   return rc;
 }
-\f
-/* Wget expects network calls such as connect, recv, send, etc., to set
-   errno on failure.  To achieve that, Winsock calls are wrapped with code
-   that, in case of error, sets errno to the value of WSAGetLastError().
-   In addition, we provide a wrapper around strerror, which recognizes
-   Winsock errors and prints the appropriate error message. */
-
-/* Define a macro that creates a function definition that wraps FUN into
-   a function that sets errno the way the rest of the code expects. */
-
-#define WRAP(fun, decl, call) int wrapped_##fun decl {  \
-  int retval = fun call;                                \
-  if (retval < 0)                                       \
-    errno = WSAGetLastError ();                         \
-  return retval;                                        \
-}
-
-WRAP (socket, (int domain, int type, int protocol), (domain, type, protocol))
-WRAP (bind, (int s, struct sockaddr *a, int alen), (s, a, alen))
-WRAP (connect, (int s, const struct sockaddr *a, int alen), (s, a, alen))
-WRAP (listen, (int s, int backlog), (s, backlog))
-WRAP (accept, (int s, struct sockaddr *a, int *alen), (s, a, alen))
-WRAP (recv, (int s, void *buf, int len, int flags), (s, buf, len, flags))
-WRAP (send, (int s, const void *buf, int len, int flags), (s, buf, len, flags))
-WRAP (select, (int n, fd_set *r, fd_set *w, fd_set *e, const struct timeval *tm),
-              (n, r, w, e, tm))
-WRAP (getsockname, (int s, struct sockaddr *n, int *nlen), (s, n, nlen))
-WRAP (getpeername, (int s, struct sockaddr *n, int *nlen), (s, n, nlen))
-WRAP (setsockopt, (int s, int level, int opt, const void *val, int len),
-                  (s, level, opt, val, len))
-WRAP (closesocket, (int s), (s))
 
 \f
 #ifdef ENABLE_IPV6
index bb72a2823e8c9ee8bddb620159b2f4a6094735ae..12f55833044dc424270005a2e431540da0d688fd 100644 (file)
@@ -121,38 +121,6 @@ const char *inet_ntop (int, const void *, char *, socklen_t);
 # define gai_strerror strerror
 #endif
 
-#ifndef INHIBIT_WRAP
-
-/* Winsock functions don't set errno, so we provide wrappers that do. */
-
-#define socket wrapped_socket
-#define bind wrapped_bind
-#define connect wrapped_connect
-#define listen wrapped_listen
-#define accept wrapped_accept
-#define recv wrapped_recv
-#define send wrapped_send
-#define select wrapped_select
-#define getsockname wrapped_getsockname
-#define getpeername wrapped_getpeername
-#define setsockopt wrapped_setsockopt
-#define closesocket wrapped_closesocket
-
-#endif /* not INHIBIT_WRAP */
-
-int wrapped_socket (int, int, int);
-int wrapped_bind (int, struct sockaddr *, int);
-int wrapped_connect (int, const struct sockaddr *, int);
-int wrapped_listen (int s, int backlog);
-int wrapped_accept (int s, struct sockaddr *a, int *alen);
-int wrapped_recv (int, void *, int, int);
-int wrapped_send (int, const void *, int, int);
-int wrapped_select (int, fd_set *, fd_set *, fd_set *, const struct timeval *);
-int wrapped_getsockname (int, struct sockaddr *, int *);
-int wrapped_getpeername (int, struct sockaddr *, int *);
-int wrapped_setsockopt (int, int, int, const void *, int);
-int wrapped_closesocket (int);
-
 /* Public functions.  */
 
 void ws_startup (void);