Commit graph

19 commits

Author SHA1 Message Date
Ron Koenderink
68fd5e0c89 (sys/socket.h) [_WIN32]: Add comment to explain the include order
dependencies.
2007-08-29 23:07:33 +00:00
Ron Koenderink
afedb8c9e2 (posix_accept, posix_bind, posix_listen, posix_setsockopt,
posix_shutdown, posix_socket, socklen_t) [_WIN32]: Move socket
related externs to sys/socket.h.

(inet_ntop) [_WIN32]: Move extern to inet.h.

(tcp_listen): Remove the !WIN32 includes and use the revised
sys/socket.h, netinet/in.h, arpa/inet.h and netdb.h.
2007-08-28 21:06:22 +00:00
Ron Koenderink
b65c2dd5ba (posix_close, posix_read, posix_write) [_WIN32]:
Move CANT_REACH() and return -1 into a default case.
Removes warnings for MinGW of potential missing cases.

(posix_accept, posix_socket) [_WIN32]: Switch handle to SOCKET
to match Windows call.  Cast to an int for translation map.
2007-08-26 23:04:14 +00:00
Ron Koenderink
2abd68e46e (inet_ntop) [_WIN32]: Improve the error checking for getnameinfo(). 2007-08-24 21:46:32 +00:00
Ron Koenderink
5299580260 (posix_fileno) [_WIN32]: Rename posix_fileno() to fileno().
Remove the extern posix_fileno().

(fileno) [_WIN32]: Replace system fileno() with a function that supports posix
file descriptors.  Move #undef fileno to w32misc.h as the system define
is in stdio.h.

(rea) [_WIN32]: Add stdio.h for fileno() extern declaration and add misc.h
to ensure the WIN32 fixes to stdio.h are included.
2007-08-24 21:05:59 +00:00
71485ac5a0 (readv): Cope with malloc(0) returning null pointer.
(writev): call write() even when total size is zero.
2007-08-24 16:59:17 +00:00
Ron Koenderink
5bb91bd98b (inet_ntop) [_WIN32]: Add HAVE_GETADDRINFO around inet_ntop.
MinGW does not support getnameinfo() for Windows 2000 or earlier.
2007-08-23 03:02:19 +00:00
Ron Koenderink
6d8ff43cd4 (inet_ntop) [_WIN32]: New. Windows equivalent for inet_ntop().
[_WIN32]: New in.h, inet.h, netdb.h.  Windows equivalent for POSIX
includes.

(tcp_connect): Use new include files and inet_ntop().
Allows tcp_connect() to compile when HAVE_GETADDRINFO is enabled.
2007-08-21 13:46:21 +00:00
Ron Koenderink
af4c12d9b3 Standardize include file order. 2007-08-20 20:20:16 +00:00
Ron Koenderink
6ea6cd55e6 Replace winsock2.h and undef NS_ALL with sys/socket.h to prevent
multiple occurences undef NS_ALL from nesting include files.
2007-08-20 20:18:33 +00:00
Ron Koenderink
7d53597331 Replace the incorrectly commented out file prototypes.h with
misc.h.
2007-08-20 20:13:56 +00:00
Ron Koenderink
b5c4250099 [_WIN32]: Remove empio.h, not required anymore. 2007-08-19 21:44:11 +00:00
318f4b10f3 (mode_t, off_t): New.
(posix_mkdir, posix_bind, posix_setsockopt, posix_lseek, posix_read)
(posix_write): Fix prototypes to conform to POSIX.
2007-08-19 09:11:38 +00:00
Ron Koenderink
049bf68035 (va_start) [_WIN32]: For va_start() requires stdarg.h and stdio.h. 2007-08-19 00:55:14 +00:00
Ron Koenderink
6dbe7debe4 (mkdir) [_WIN32]: Remove direct.h from posixio.c, not need. 2007-08-19 00:41:44 +00:00
4caa4c6cc9 (setsockopt): Fix type of argument optval to conform to spec. 2007-08-18 07:00:16 +00:00
Ron Koenderink
01625ead8c (tcp_listen, posix_setsockopt) [_WIN32]: Move the special
SO_REUSEADDR code for _WIN32 from tcp_listen() to
posix_setsockopt().

[_WIN32] (posix_open): Switch to _sopen() for _sopen_s() as MinGW
does not support _sopen_s() yet.

[_WIN32] (posix_fd2socket): Fix typo.
2007-08-17 03:11:45 +00:00
Ron Koenderink
af64cfd491 [_WIN32] (readv, writev, iovec): New. POSIX equivalents.
(ioq_makeiov, ioqtoiov): Compile unconditionally.
(io_output): Use POSIX code unconditionally.
[_WIN32] (ioq_makebuf): Remove.
2007-08-16 21:43:20 +00:00
Ron Koenderink
4bbc3f4286 Simple POSIX I/O emulation layer to work around Windows's defective
Unix I/O:
[_WIN32] (socklen_t, accept, posix_accept, bind. posix_bind, listen)
(posix_listen, setsockopt, posix_setsockopt, shutdown, posix_shutdown)
(socket, posix_socket, close, posix_close, creat, fstat, posix_fstat)
(lseek, posix_lseek, open, posix_open, read, posix_read, write)
(posix_write, fileno, posix_fileno, fcntl, O_NONBLOCK, F_RDLCK)
(F_WRLCK, F_GETFL, F_SETFL, F_SETLK, EWOULDBLOCK, ENOTSOCK)
(flock, fsync, posix_fsync):
New.
(ef_open, io_close, io_input, io_output, io_shutdown, io_noblocking)
(player_accept): Use them to simplify.
[_WIN32] (posix_fd2socket): New.
(empth_select): Use it.
(gen_power): Use it.
2007-08-14 03:33:28 +00:00