]> git.pond.sub.org Git - empserver/blobdiff - src/lib/w32/sys/socket.h
Update copyright notice
[empserver] / src / lib / w32 / sys / socket.h
index ac5927acd4461f99555dbb89c619a6004c9444f5..e5348be8836a8e81d603df74383da743eff109fc 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
+ *  Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *                Ken Stevens, Steve McClure, Markus Armbruster
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  Empire is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  *  ---
  *
@@ -29,6 +28,7 @@
  *
  *  Known contributors to this file:
  *     Ron Koenderink, 2007
+ *     Markus Armbruster, 2009-2013
  */
 
 #ifndef SYS_SOCKET_H
 #include <winsock2.h>
 #undef NS_ALL
 
+typedef unsigned short sa_family_t;
 typedef int socklen_t;
 
 #define accept(fd, addr, addrlen) \
     w32_accept((fd), (addr), (addrlen))
 #define bind(fd, name, namelen) \
     w32_bind((fd), (name), (namelen))
+#define connect(fd, addr, addrlen) \
+    w32_connect((fd), (addr), (addrlen))
 #define listen(fd, backlog) \
     w32_listen((fd), (backlog))
 #define setsockopt(fd, level, optname, optval, optlen) \
@@ -54,6 +57,7 @@ typedef int socklen_t;
 
 extern int w32_accept(int fd, struct sockaddr *addr, socklen_t *addrlen);
 extern int w32_bind(int fd, const struct sockaddr *name, socklen_t namelen);
+extern int w32_connect(int fd, const struct sockaddr *addr, socklen_t addrlen);
 extern int w32_listen(int fd, int backlog);
 extern int w32_setsockopt(int fd, int level, int optname,
                          const void *optval, socklen_t optlen);
@@ -65,4 +69,8 @@ extern SOCKET w32_fd2socket(int fd);
 extern void w32_set_winsock_errno(void);
 extern int w32_socket_init(void);
 
+#ifndef SHUT_WR
+#define SHUT_WR SD_SEND
+#endif
+
 #endif /* SYS_SOCKET_H */