From 10f290cdf30a8743e553c954e57a00922e4b5c97 Mon Sep 17 00:00:00 2001
From: hniksic <devnull@localhost>
Date: Sun, 3 Jul 2005 13:43:57 -0700
Subject: [PATCH] [svn] Also wrap accept() and listen() on Windows.

---
 src/ChangeLog   | 4 ++++
 src/mswindows.c | 2 ++
 src/mswindows.h | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/src/ChangeLog b/src/ChangeLog
index a51ad87d..7e4088fe 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2005-07-03  Hrvoje Niksic  <hniksic@xemacs.org>
+
+	* mswindows.h: Also wrap accept() and listen().
+
 2005-07-03  Hrvoje Niksic  <hniksic@xemacs.org>
 
 	* url.c (path_end): Skip separators appropriate for the scheme.
diff --git a/src/mswindows.c b/src/mswindows.c
index 245114fe..93eb71d1 100644
--- a/src/mswindows.c
+++ b/src/mswindows.c
@@ -752,6 +752,8 @@ run_with_timeout (double seconds, void (*fun) (void *), void *arg)
 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),
diff --git a/src/mswindows.h b/src/mswindows.h
index 877bbff3..df8e8c2d 100644
--- a/src/mswindows.h
+++ b/src/mswindows.h
@@ -149,6 +149,8 @@ const char *inet_ntop (int, const void *, char *, socklen_t);
 #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
@@ -162,6 +164,8 @@ const char *inet_ntop (int, const void *, char *, socklen_t);
 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 *);