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 <netdb.h>
#include <unistd.h> #include <unistd.h>
#else #else
#include <io.h>
#include <winsock.h> #include <winsock.h>
#endif #endif
#include <ctype.h> #include <ctype.h>

View file

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

View file

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

View file

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

View file

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

View file

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