From: Andrew Burt Date: Sat, 23 Jan 1988 14:57:57 +0000 (+0000) Subject: perl 1.0 patch 2: Various portability fixes. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=135863df38bea8d721a115b5d13e08b816104784;p=p5sagit%2Fp5-mst-13.2.git perl 1.0 patch 2: Various portability fixes. Some things didn't work right on System V and Pyramids. --- diff --git a/Configure b/Configure index 66d8a6e..7327e1c 100755 --- a/Configure +++ b/Configure @@ -8,7 +8,7 @@ # and edit it to reflect your system. Some packages may include samples # of config.h for certain machines, so you might look for one of those.) # -# $Header: Configure,v 1.0.1.1 88/01/21 21:21:47 root Exp $ +# $Header: Configure,v 1.0.1.2 88/01/24 03:51:55 root Exp $ # # Yes, you may rip this off to use in other distribution packages. # (Note: this Configure script was generated automatically. Rather than @@ -68,10 +68,13 @@ cc='' contains='' cpp='' cppminus='' +d_bcopy='' d_charsprf='' d_index='' +d_statblks='' d_stdstdio='' d_strctcpy='' +d_tminsys='' d_vfork='' d_voidsig='' libc='' @@ -638,6 +641,16 @@ else fi rm -f testcpp.c testcpp.out +: see if bcopy exists +echo " " +if $contains bcopy libc.list >/dev/null 2>&1; then + echo 'bcopy() found.' + d_bcopy="$define" +else + echo 'bcopy() not found.' + d_bcopy="$undef" +fi + : see if sprintf is declared as int or pointer to char echo " " if $contains 'char.*sprintf' /usr/include/stdio.h >/dev/null 2>&1 ; then @@ -671,6 +684,21 @@ else esac fi +: see if stat knows about block sizes +echo " " +if $contains 'st_blocks;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then + if $contains 'st_blksize;' /usr/include/sys/stat.h >/dev/null 2>&1 ; then + echo "Your stat knows about block sizes." + d_statblks="$define" + else + echo "Your stat doesn't know about block sizes." + d_statblks="$undef" + fi +else + echo "Your stat doesn't know about block sizes." + d_statblks="$undef" +fi + : see if stdio is really std echo " " if $contains 'char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then @@ -708,6 +736,16 @@ else fi $rm -f try.* +: see if struct tm is defined in sys/time.h +echo " " +if $contains 'struct tm' /usr/include/time.h >/dev/null 2>&1 ; then + echo "You have struct tm defined in rather than ." + d_tminsys="$undef" +else + echo "You have struct tm defined in rather than ." + d_tminsys="$define" +fi + : see if there is a vfork echo " " if $contains vfork libc.list >/dev/null 2>&1 ; then @@ -1260,10 +1298,13 @@ cc='$cc' contains='$contains' cpp='$cpp' cppminus='$cppminus' +d_bcopy='$d_bcopy' d_charsprf='$d_charsprf' d_index='$d_index' +d_statblks='$d_statblks' d_stdstdio='$d_stdstdio' d_strctcpy='$d_strctcpy' +d_tminsys='$d_tminsys' d_vfork='$d_vfork' d_voidsig='$d_voidsig' libc='$libc' diff --git a/Makefile.SH b/Makefile.SH index f45bb3f..7814bd9 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -14,16 +14,15 @@ case "$0" in esac echo "Extracting Makefile (with variable substitutions)" cat >Makefile < +#include "EXTERN.h" +#include "handy.h" +#include "search.h" +#include "perl.h" + +/* I don't much care whether these are defined in sys/types.h--LAW */ + +#define u_char unsigned char +#define u_int unsigned int +#define u_short unsigned short #define NULL 0 diff --git a/patchlevel.h b/patchlevel.h index 110c86f..e3d7670 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -1 +1 @@ -#define PATCHLEVEL 1 +#define PATCHLEVEL 2 diff --git a/perl.h b/perl.h index ce2d2ab..751b8cd 100644 --- a/perl.h +++ b/perl.h @@ -1,6 +1,9 @@ -/* $Header: perl.h,v 1.0.1.1 88/01/21 21:29:23 root Exp $ +/* $Header: perl.h,v 1.0.1.2 88/01/24 03:53:47 root Exp $ * * $Log: perl.h,v $ + * Revision 1.0.1.2 88/01/24 03:53:47 root + * patch 2: hid str_peek() in #ifdef DEBUGGING. + * * Revision 1.0.1.1 88/01/21 21:29:23 root * No longer defines STDSTDIO--gets it from config.h now. * @@ -24,7 +27,13 @@ #include #include #include + +#ifdef TMINSYS +#include +#else #include +#endif + #include typedef struct arg ARG; @@ -46,6 +55,12 @@ typedef struct htbl HASH; #include "array.h" #include "hash.h" +#ifdef CHARSPRINTF + char *sprintf(); +#else + int sprintf(); +#endif + /* A string is TRUE if not "" or "0". */ #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1]))) EXT char *Yes INIT("1"); @@ -53,7 +68,10 @@ EXT char *No INIT(""); #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 ))) +#ifdef DEBUGGING #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" ))) +#endif + #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str))) #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str))) EXT STR *Str; @@ -185,12 +203,6 @@ double atof(); long time(); struct tm *gmtime(), *localtime(); -#ifdef CHARSPRINTF - char *sprintf(); -#else - int sprintf(); -#endif - #ifdef EUNICE #define UNLINK(f) while (unlink(f) >= 0) #else diff --git a/perly.c b/perly.c index 641971b..dfd83d9 100644 --- a/perly.c +++ b/perly.c @@ -1,6 +1,9 @@ -char rcsid[] = "$Header: perly.c,v 1.0.1.1 88/01/21 21:25:57 root Exp $"; +char rcsid[] = "$Header: perly.c,v 1.0.1.2 88/01/24 00:06:03 root Exp $"; /* * $Log: perly.c,v $ + * Revision 1.0.1.2 88/01/24 00:06:03 root + * patch 2: s/(abc)/\1/ grandfathering didn't work right. + * * Revision 1.0.1.1 88/01/21 21:25:57 root * Now uses CPP and CPPMINUS symbols from config.h. * @@ -1646,7 +1649,7 @@ register char *s; *d <<= 3; *d += *s++ - '0'; } - else if (!index('`"',term)) { /* oops, a subpattern */ + else if (!index("`\"",term)) { /* oops, a subpattern */ s--; goto defchar; } diff --git a/search.c b/search.c index 79712a1..b812ee1 100644 --- a/search.c +++ b/search.c @@ -1,6 +1,9 @@ -/* $Header: search.c,v 1.0 87/12/18 13:05:59 root Exp $ +/* $Header: search.c,v 1.0.1.1 88/01/24 03:55:05 root Exp $ * * $Log: search.c,v $ + * Revision 1.0.1.1 88/01/24 03:55:05 root + * patch 2: made depend on perl.h. + * * Revision 1.0 87/12/18 13:05:59 root * Initial revision * @@ -8,14 +11,13 @@ /* string search routines */ -#include -#include - #include "EXTERN.h" #include "handy.h" #include "util.h" #include "INTERN.h" #include "search.h" +#include "EXTERN.h" +#include "perl.h" #define VERBOSE #define FLUSH diff --git a/t/TEST b/t/TEST index 11c48e2..451bbe6 100644 --- a/t/TEST +++ b/t/TEST @@ -1,6 +1,6 @@ #!./perl -# $Header: TEST,v 1.0 87/12/18 13:11:34 root Exp $ +# $Header: TEST,v 1.0.1.1 88/01/24 03:55:39 root Exp $ # This is written in a peculiar style, since we're trying to avoid # most of the constructs we'll be testing for. @@ -14,10 +14,29 @@ if ($ARGV[0] eq '') { @ARGV = split(/[ \n]/,`echo base.* comp.* cmd.* io.* op.*`); } +open(config,"../config.sh"); +while () { + if (/sharpbang='(.*)'/) { + $sharpbang = ($1 eq '#!'); + last; + } +} $bad = 0; while ($test = shift) { print "$test..."; - open(results,"$test|") || (print "can't run.\n"); + if ($sharpbang) { + open(results,"$test|") || (print "can't run.\n"); + } else { + open(script,"$test") || die "Can't run $test"; + $_ =