Windows cleanup: include proper headers, remove unused variables, fix

type of signal handler.  Mostly from Ron Koenderink.
This commit is contained in:
Markus Armbruster 2004-02-16 17:44:38 +00:00
parent cc5d78c2f0
commit 7dbb87b0e0
6 changed files with 13 additions and 15 deletions

View file

@ -43,6 +43,7 @@
#include <netdb.h>
#include <unistd.h>
#else
#include <io.h>
#include <winsock.h>
#endif
#include <ctype.h>

View file

@ -60,6 +60,7 @@
#include <windows.h>
#include <winsock.h>
#include <conio.h>
#include <io.h>
#endif
#ifdef _WIN32
@ -85,6 +86,8 @@ int serverio();
void servercmd();
void ioq_drain();
static void intr(int sig);
int
main(ac, av)
@ -96,16 +99,12 @@ s_char *av[];
int err;
fd_set readfds;
struct timeval tm;
INPUT_RECORD InpBuffer[10];
DWORD numevents;
DWORD stdinmode;
SECURITY_ATTRIBUTES security;
void intr(void);
#endif
extern s_char empireport[];
extern s_char empirehost[];
fd_set mask;
fd_set savemask;
struct ioqueue server;
s_char *argv[128];
int i, j;
@ -113,8 +112,8 @@ s_char *av[];
s_char *auxout_fname;
FILE *auxout_fp;
#ifndef _WIN32
fd_set savemask;
struct passwd *pwd;
void intr();
#endif
struct sockaddr_in sin;
int n;
@ -302,12 +301,8 @@ s_char *av[];
return 0; /* Shut the compiler up */
}
void
#ifdef _WIN32
intr(void)
#else
intr()
#endif
static void
intr(int sig)
{
interrupt++;
#ifdef hpux

View file

@ -44,6 +44,8 @@
#include <fcntl.h>
#if !defined(_WIN32)
#include <unistd.h>
#else
#include <io.h>
#endif
extern s_char *gettag();

View file

@ -44,6 +44,7 @@
#ifdef _WIN32
#include <winsock.h>
#include <io.h>
#endif
void ioq_write();

View file

@ -46,6 +46,7 @@
#include <sgtty.h>
#else
#include <winsock.h>
#include <io.h>
#endif /* _WIN32 */
#endif
#include "misc.h"

View file

@ -68,13 +68,11 @@ getsose()
{
#ifndef _WIN32
extern s_char *tgetstr();
#endif
static s_char tbuf[1024];
static s_char cbuf[20];
s_char *cp;
s_char *term;
static s_char tbuf[1024];
static s_char cbuf[20];
#ifndef _WIN32
memset((s_char *)&cbuf[0], 0, 20);
term = getenv("TERM");
if (term == 0) {