From: Winfried Koenig Date: Sun, 22 Dec 1996 03:14:00 +0000 (+0200) Subject: Fixes for Interactive Unix X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ab5d0547ab7398ea9e3e00b1c1b0f1f8ea0dd94;p=p5sagit%2Fp5-mst-13.2.git Fixes for Interactive Unix This is a bug report for perl from win@in.rhein-main.de, generated with the help of perlbug 1.14 running under perl 5.00313. With the following patches, perl compiles and passes all tests on Interactiv Unix Version 4.1. I tested with cc and with gcc. p5p-msgid: --- diff --git a/hints/isc.sh b/hints/isc.sh index df745a9..1aa14e1 100644 --- a/hints/isc.sh +++ b/hints/isc.sh @@ -27,6 +27,8 @@ case "$cc" in ldflags="$ldflags -Xp" ;; esac +# fix some errors of libinet.a and compiler +ccflags="$ccflags -D_SYS_ISC" # You can also include -D_SYSV3 to pick up "traditionally visible" # symbols hidden by name-space pollution rules. This raises some diff --git a/op.c b/op.c index 56624e3..619b675 100644 --- a/op.c +++ b/op.c @@ -186,7 +186,7 @@ pad_findlex(char *name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix) if ((sv = svp[off]) && sv != &sv_undef && seq <= SvIVX(sv) && - seq > (I32)SvNVX(sv) && + seq > I_32(SvNVX(sv)) && strEQ(SvPVX(sv), name)) { I32 depth; @@ -277,7 +277,7 @@ char *name; if ((sv = svp[off]) && sv != &sv_undef && seq <= SvIVX(sv) && - seq > (I32)SvNVX(sv) && + seq > I_32(SvNVX(sv)) && strEQ(SvPVX(sv), name)) { return (PADOFFSET)off; diff --git a/pp_sys.c b/pp_sys.c index 5e096fe..aecf013 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -121,7 +121,7 @@ static int dooneliner _((char *cmd, char *filename)); # endif /* no flock() or fcntl(F_SETLK,...) */ # ifdef FLOCK - static int FLOCK(int, int); + static int FLOCK _((int, int)); /* * These are the flock() constants. Since this sytems doesn't have @@ -1860,6 +1860,12 @@ PP(pp_getpeername) goto nuts2; break; } +#ifdef _SYS_ISC + /* Interactive Unix, getpeername() and getsockname() + does not return valid namelen */ + if (aint == 256) + aint = sizeof(struct sockaddr); +#endif SvCUR_set(sv,aint); *SvEND(sv) ='\0'; PUSHs(sv); diff --git a/universal.c b/universal.c index 476b60d..3cd7166 100644 --- a/universal.c +++ b/universal.c @@ -198,6 +198,9 @@ XS(XS_UNIVERSAL_VERSION) GV *gv; SV *sv; char *undef; +#ifdef _SYS_ISC + double req = SvNV(ST(1)); +#endif if(SvROK(ST(0))) { sv = (SV*)SvRV(ST(0)); @@ -222,7 +225,12 @@ XS(XS_UNIVERSAL_VERSION) undef = "(undef)"; } +#ifdef _SYS_ISC + /* needed for C compiler of Interactive Unix */ + if(items > 1 && (undef || (req = SvNV(ST(1)) && req > SvNV(sv)))) +#else if(items > 1 && (undef || SvNV(ST(1)) > SvNV(sv))) +#endif croak("%s version %s required--this is only version %s", HvNAME(pkg),SvPV(ST(1),na),undef ? undef : SvPV(sv,na));