Commit graph

2807 commits

Author SHA1 Message Date
8d8c6972a1 (ssize_t): Match system's size_t more closely. 2007-08-24 17:07:48 +00:00
09e7abbd0d (output): Remove unused parameter eol. Caller changed. 2007-08-24 17:05:18 +00:00
1d330548ea Fix grammar for human-readable header.
Clarify state of symbolic indexes.
2007-08-24 17:03:44 +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
c2cf7ddd2c (buil_bc): Reduce bridge span cost to $1000.
(buil_tower_bc): Reduce bridge tower cost to $3000.
2007-08-23 18:26:04 +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
82f8738b16 (mode_t) [_WIN32]: Switch to unsigned short to match the declaration
in the MinGW for mode_t.
2007-08-22 02:17:07 +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
9cd99dd336 (tcp_connect) [_WIN32]: Add ws2tcpip.h to allow tcp_connect() to
compile when HAVE_GETADDRINFO is enabled.
2007-08-20 20:01:47 +00:00
Ron Koenderink
d9ddf9b24a (tcp_connect, hostconnect) [_WIN32]: Replace close() with
closesocket() as Windows close() does not support closing
socket connections.
2007-08-20 19:59:12 +00:00
Ron Koenderink
b5c4250099 [_WIN32]: Remove empio.h, not required anymore. 2007-08-19 21:44:11 +00:00
Ron Koenderink
c2e4f233aa [_WIN32]: Remove unnecessary Windows include files. 2007-08-19 15:21:42 +00:00
ae18cad100 (flock): Fix member types to conform to POSIX. 2007-08-19 14:19:52 +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
95bdfebe78 Don't include direct.h, as our fake unistd.h now does the job. 2007-08-19 06:41:59 +00:00
Ron Koenderink
45e6ef2f9f (getopt) [_WIN32]: Only getopt.c for MSC. MinGW has getopt()
in the library.
2007-08-19 01:51:34 +00:00
Ron Koenderink
fd4bed679b (strptime) [_WIN32]: Postpone the declaration of the struct tm for strptime().
Pick up the declaration for struct tm when time.h is included in the source file.
2007-08-19 01:47:43 +00:00
Ron Koenderink
d5ffce4aa8 (getcwd) [_WIN32]: getcwd() is included in unistd.h in POSIX so
add <direct.h> into the windows equivalent for unistd.h.
2007-08-19 01:40:14 +00:00
Ron Koenderink
71669b1858 (getopt) [_WIN32]: In order to prevent namespace conflict between MSC and
MinGW created an extern getopt() in unistd.h.  MinGW has getopt() in the library.
MSC does not have getopt() function.
2007-08-19 01:37:25 +00:00
Ron Koenderink
c47f59e189 (fileno) [_WIN32]: Remove unnecessary #ifdef fileno/#endif. 2007-08-19 01:20:00 +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
2e012c8fa3 (va_start) [_WIN32]: For va_start() requires stdarg.h. 2007-08-19 00:54:29 +00:00
Ron Koenderink
6dbe7debe4 (mkdir) [_WIN32]: Remove direct.h from posixio.c, not need. 2007-08-19 00:41:44 +00:00
404095d2fa Trim system includes. 2007-08-18 17:03:14 +00:00
ce177501ef Include config.h. 2007-08-18 16:54:37 +00:00
09cb4ca532 Portability fix: include all headers traditionally required for
select().
2007-08-18 16:28:56 +00:00
10dd9aea11 (fltelemstr, fltheadstr): Move from ship.h to sail.c. 2007-08-18 13:48:15 +00:00
198b7760d8 (exec_fd): Useless junk inherited all the way from BSD Empire 1.1.
Remove.
2007-08-18 09:24:05 +00:00
4caa4c6cc9 (setsockopt): Fix type of argument optval to conform to spec. 2007-08-18 07:00:16 +00:00
Ron Koenderink
1a3a7b9837 Add additional includes for compiling in MinGW. 2007-08-17 20:45:55 +00:00
Ron Koenderink
3c7bb12c09 Switch the !__GNUC__ with _MSC_VER to be more reflective of the
purpose.

(strptime) [_WIN32]: Add time.h for extern prototypes.
2007-08-17 20:43:32 +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
b892774785 Include sys/uio.h unconditionally. 2007-08-17 03:06:35 +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
a9c872f006 Back out the previous revision and remove the include of sys/types.h
instead.
2007-08-16 10:41:30 +00:00
Ron Koenderink
3bdad8ce26 For w32misc.h add the POSIX equivalent include file for each
declaration.
2007-08-16 03:15:33 +00:00
Ron Koenderink
222894093d (ssize_t, pid_t) [_WIN32]: Back out the previous revision of unistd.h
and move to w32misc.h instead.  Belong into sys/types.h but we can't
fix system headers.
2007-08-16 03:03:22 +00:00
Ron Koenderink
f835548ee7 Include sys/uio.h unconditionally. 2007-08-15 02:46:08 +00:00
Ron Koenderink
6181fd10bf [_WIN32] Provide POSIX-style sys/socket.h. Use it rather than
winsock2.h.
2007-08-15 02:40:53 +00:00
Ron Koenderink
2863aba452 [_WIN32]: Remove unnecessary <io.h> for WIN32. 2007-08-15 02:18:25 +00:00
Ron Koenderink
c7f940a84e Move WIN32 equivalent function defines to w32/w32misc.h from misc.h.
Move Microsoft C compiler warning to w32/w32misc.h from misc.h.
2007-08-15 02:15:17 +00:00
Ron Koenderink
287aa9d162 (ssize_t, pid_t) [_WIN32]: Move from misc.h to POSIX's location
in unistd.h.
2007-08-15 01:48:40 +00:00
Ron Koenderink
9e1e242b4e (serverio, sendoef) [_WIN32]: For WIN32 use closesocket() instead of
close() as close() is not valid for WIN32 sockets.
2007-08-15 01:18:48 +00:00
Ron Koenderink
9c666a7423 Create w32misc.h to contain information that does not fit in Windows
equivalent include file.
(strptime) [_WIN32]: Add extern for WIN32 equivalent for strptime().
2007-08-15 01:16:26 +00:00
Ron Koenderink
7bb0a04db2 [_WIN32] (S_IRUSR, S_IWUSR, S_IXUSR, S_IRWXU, S_IRGRP, S_IWGRP)
(S_IXGRP, S_IRWXG, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXO): Move from
include/misc.h to new src/lib/w32/unistd.h.
2007-08-14 03:38:18 +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
Ron Koenderink
e7b04123a9 [_WIN32] (posix_mkdir): New.
[_WIN32] (mkdir): Use it.  Last argument is no longer ignored, which
was a bug.  Move declaration to unistd.h, which isn't quite right, but
works for us.
2007-08-14 03:11:26 +00:00