From f5b04a48abc50f82e5cf286a0a07f9b497d7e064 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Thu, 6 Jan 2005 22:21:59 +0000 Subject: [PATCH] Several ports fixes --- ChangeLog | 6 ++++++ lib/Makefile | 2 +- lib/mbselib.h | 4 +++- lib/signame.c | 4 ++-- lib/strutil.c | 2 ++ mbcico/hydra.c | 2 +- mbcico/tcpproto.c | 2 +- mbcico/zmsend.c | 2 +- mbsebbs/offline.c | 4 ++-- mbtask/signame.c | 2 +- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c0e146f..6be72659 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,12 @@ $Id$ v0.71.1 28-Nov-2004 + porting: + Compiles more or less on x86_64, there are issues with utmp + and struct lastlog + Compiles on NetBSD i386. + Compiles in Alpha. + upgrade: Make sure you remove everything related to bbslist menus from your menus and txtfiles. diff --git a/lib/Makefile b/lib/Makefile index cf6d5b97..376f1787 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -84,7 +84,7 @@ libnodelist.a: ${NODELIST_OBJS} ar r $@ $? ${RANLIB} $@ -mbcharsetc: ${CHC_OBJS} ${LIBS} +mbcharsetc: ${CHC_OBJS} ${CC} -o mbcharsetc ${CHC_OBJS} ${LDFLAGS} ${LIBS} charset.bin: mbcharsetc ${MAPS} diff --git a/lib/mbselib.h b/lib/mbselib.h index dbbaae22..6a48fa16 100644 --- a/lib/mbselib.h +++ b/lib/mbselib.h @@ -90,7 +90,9 @@ #include #endif #include +#if !defined(__ppc__) #include +#endif /* used to use #elif, but native braindead hpux 9.00 c compiler didn't * * understand it */ @@ -138,7 +140,7 @@ struct termios; #include #include -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__ppc__) #include #include #endif diff --git a/lib/signame.c b/lib/signame.c index 03958256..c86e124d 100644 --- a/lib/signame.c +++ b/lib/signame.c @@ -36,7 +36,7 @@ * Signal handler signal names. */ -#if defined(__i386__) +#if defined(__i386__) || defined(__x86_64__) char SigName[32][16] = { "NOSIGNAL", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", @@ -48,7 +48,7 @@ char SigName[32][16] = { "NOSIGNAL", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH", "SIGIO", "SIGPWR", "SIGUNUSED"}; -#elif defined(__PPC__) +#elif defined(__PPC__) || defined(__ppc__) char SigName[32][16] = { "NOSIGNAL", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", diff --git a/lib/strutil.c b/lib/strutil.c index ade4062a..18496c25 100644 --- a/lib/strutil.c +++ b/lib/strutil.c @@ -354,6 +354,8 @@ char *OsCPU() { #ifdef __i386__ return (char *)"i386"; +#elif __x86_64__ + return (char *)"x86_64"; #elif __PPC__ return (char *)"PPC"; #elif __sparc__ diff --git a/mbcico/hydra.c b/mbcico/hydra.c index da159838..c8f9ab55 100644 --- a/mbcico/hydra.c +++ b/mbcico/hydra.c @@ -902,7 +902,7 @@ int hydra_batch(int role, file_list *to_send) } else { if (to_send) { txlen = sprintf(txbuf, "%08lx%08lx%08lx%08lx%08lx", - mtime2sl(txstat.st_mtime+(txstat.st_mtime%2)), + (long)mtime2sl(txstat.st_mtime+(txstat.st_mtime%2)), (long)(txstat.st_size), 0UL, 0UL, 0UL); /* diff --git a/mbcico/tcpproto.c b/mbcico/tcpproto.c index 4f380c53..692d1283 100644 --- a/mbcico/tcpproto.c +++ b/mbcico/tcpproto.c @@ -222,7 +222,7 @@ static int sendtfile(char *ln, char *rn) return 0; } - sprintf(txbuf,"S %s %lu %lu",rn,(unsigned long)st.st_size,st.st_mtime+(st.st_mtime%2)); + sprintf(txbuf,"S %s %lu %lu",rn,(unsigned long)st.st_size,(unsigned long)st.st_mtime+(st.st_mtime%2)); bufl = strlen(txbuf); rc = tcp_sblk(txbuf, bufl, TCP_CMD); rc = tcp_rblk(rxbuf, &bufl); diff --git a/mbcico/zmsend.c b/mbcico/zmsend.c index 91f441b4..f9a3a689 100644 --- a/mbcico/zmsend.c +++ b/mbcico/zmsend.c @@ -213,7 +213,7 @@ static int sendzfile(char *ln, char *rn) Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime)); gettimeofday(&starttime, &tz); - sprintf(txbuf,"%s %lu %lo %o 0 0 0", rn,(unsigned long)st.st_size, st.st_mtime+(st.st_mtime%2), st.st_mode); + sprintf(txbuf,"%s %lu %lo %o 0 0 0", rn,(unsigned long)st.st_size, (long)st.st_mtime+((long)st.st_mtime%2), st.st_mode); bufl = strlen(txbuf); *(strchr(txbuf,' ')) = '\0'; /*hope no blanks in filename*/ diff --git a/mbsebbs/offline.c b/mbsebbs/offline.c index b9e09b0b..881c761a 100644 --- a/mbsebbs/offline.c +++ b/mbsebbs/offline.c @@ -2584,7 +2584,7 @@ unsigned long QWK_PackArea(unsigned long ulLast, long Area) Total++; memset(&Qwk, ' ', sizeof(Qwk)); - sprintf(Temp, "%-*lu", sizeof(Qwk.Msgnum), (long)Number); + sprintf(Temp, "%-*lu", (int)sizeof(Qwk.Msgnum), (long)Number); Syslog('M', "Message %s", Temp); memcpy(Qwk.Msgnum, Temp, sizeof(Qwk.Msgnum)); tp = localtime(&Msg.Written); @@ -2617,7 +2617,7 @@ unsigned long QWK_PackArea(unsigned long ulLast, long Area) Size += fwrite(Temp, (int)(128L - (Size % 128L)), 1, fdm); } - sprintf(Qwk.Msgrecs, "%-*lu", sizeof(Qwk.Msgrecs), (long)((ftell(fdm) - Pos) / 128L)); + sprintf(Qwk.Msgrecs, "%-*lu", (int)sizeof(Qwk.Msgrecs), (long)((ftell(fdm) - Pos) / 128L)); fseek(fdm, Pos, SEEK_SET); fwrite(&Qwk, sizeof(Qwk), 1, fdm); fseek(fdm, 0L, SEEK_END); diff --git a/mbtask/signame.c b/mbtask/signame.c index 631e55a8..c3df89cc 100644 --- a/mbtask/signame.c +++ b/mbtask/signame.c @@ -36,7 +36,7 @@ * Signal handler signal names. */ -#if defined(__i386__) +#if defined(__i386__) || defined(__x86_64__) char SigName[32][16] = { "NOSIGNAL", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL",