diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-10-28 21:21:16 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-10-28 21:21:16 +0000 |
commit | d4ede91ce64eb3ddd64daea7c7434c33963c2e15 (patch) | |
tree | 04fd2cb16179526214640b88c7eea4fd8015f163 | |
parent | df0003d4dd97bb27e464c2adb8c54893f719ec3c (diff) | |
parent | aa34f1896a2ee367bc51453b669f7c047ad1b32d (diff) | |
download | perl-d4ede91ce64eb3ddd64daea7c7434c33963c2e15.tar.gz |
integrate cfgperl into mainline
p4raw-id: //depot/perl@2113
-rwxr-xr-x | Configure | 102 | ||||
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | Makefile.SH | 14 | ||||
-rw-r--r-- | config_h.SH | 10 | ||||
-rw-r--r-- | perl.h | 25 | ||||
-rw-r--r-- | perly_c.diff | 70 | ||||
-rw-r--r-- | pp.c | 7 | ||||
-rw-r--r-- | proto.h | 5 | ||||
-rwxr-xr-x | t/comp/require.t | 4 | ||||
-rwxr-xr-x | t/io/pipe.t | 23 | ||||
-rw-r--r-- | t/op/filetest.t | 42 | ||||
-rwxr-xr-x | t/op/groups.t | 11 | ||||
-rwxr-xr-x | t/op/misc.t | 4 | ||||
-rwxr-xr-x | t/pragma/subs.t | 4 | ||||
-rwxr-xr-x | t/pragma/warning.t | 3 | ||||
-rw-r--r-- | thread.h | 78 | ||||
-rw-r--r-- | toke.c | 43 | ||||
-rw-r--r-- | vmesa/Makefile | 8 |
18 files changed, 269 insertions, 185 deletions
@@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Thu Oct 22 10:24:53 EET DST 1998 [metaconfig 3.0 PL70] +# Generated on Wed Oct 28 11:58:44 EET 1998 [metaconfig 3.0 PL70] # (with additional metaconfig patches by jhi@iki.fi) cat >/tmp/c1$$ <<EOF @@ -412,7 +412,6 @@ d_portable='' d_pthread_yield='' d_sched_yield='' sched_yield='' -d_pthreads_created_joinable='' d_readdir='' d_rewinddir='' d_seekdir='' @@ -558,6 +557,7 @@ d_int64t='' i_inttypes='' i_limits='' i_locale='' +i_machcthr='' i_malloc='' i_math='' i_memory='' @@ -716,6 +716,7 @@ sh='' sig_name='' sig_name_init='' sig_num='' +sig_num_init='' installsitearch='' sitearch='' sitearchexp='' @@ -7827,8 +7828,21 @@ set inet_aton d_inetaton eval $inlibc : see if inttypes.h is available -set inttypes.h i_inttypes -eval $inhdr +: we want a real compile instead of Inhdr because some systems +: have an inttypes.h which includes non-existent headers +$cat >try.c <<EOCP +#include <inttypes.h> +extern int foo; +EOCP +set try +if eval $compile; then + val="$define" +else + val="$undef" +fi +set i_inttypes +eval $setvar + : check for int64_t case "$use64bits" in "$define" ) @@ -8234,59 +8248,6 @@ esac $rm -f try try.* -: test whether pthreads are created in joinable -- aka undetached -- state -if test "X$usethreads" = "X$define"; then - echo $n "Checking whether pthreads are created joinable. $c" >&4 - $cat >try.c <<'EOCP' -#include <pthread.h> -#include <stdio.h> -int main() { - pthread_attr_t attr; - int detachstate; - printf("%s\n", - pthread_attr_init(&attr) == 0 && -#if PTHREAD_ATTR_GETDETACHSTATE_INT - pthread_attr_getdetachstate(&attr) == 0 && -#else - pthread_attr_getdetachstate(&attr, &detachstate) == 0 && -#endif - detachstate == PTHREAD_CREATE_DETACHED ? - "detached" : "joinable"); - exit(0); -} -EOCP - set try - if eval $compile; then - yyy=`./try` - case "$yyy" in - detached) echo "Nope, they aren't." >&4 ;; - *) echo "Yup, they are." >&4 ;; - esac - else - set try -DPTHREAD_ATTR_GETDETACHSTATE_INT - if eval $compile; then - yyy=`./try` - case "$yyy" in - detached) echo "Nope, they aren't." >&4 ;; - *) echo "Yup, they are." >&4 ;; - esac - else - echo " " - echo "(I can't execute the test program--assuming they are.)" >&4 - yyy=joinable - fi - fi - $rm -f try try.* - case "$yyy" in - detached) val="$undef" ;; - *) val="$define" ;; - esac - set d_pthreads_created_joinable - eval $setvar -else - d_pthreads_created_joinable="$undef" -fi - : see if this is a pwd.h system set pwd.h i_pwd eval $inhdr @@ -8846,9 +8807,9 @@ END eval $setvar case "$d_semctl_semid_ds" in $define) - echo "You can $also use struct semid_ds * for semctl IPC_STAT." >&4 + echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4 ;; - *) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4 + *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4 ;; esac $rm -f try.h @@ -10864,7 +10825,9 @@ EOM : The first arg can be int, unsigned, or size_t : The last arg may or may not be 'const' val='' - for xxx in 'fd_set *' 'int *' 'void *'; do + : void pointer has been seen but using that + : breaks the selectminbits test + for xxx in 'fd_set *' 'int *'; do for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do for tmo in 'struct timeval *' 'const struct timeval *'; do case "$val" in @@ -11199,7 +11162,13 @@ $eunicefix signal_cmd : generate list of signal names echo " " case "$sig_name_init" in -'') +'') doinit=yes ;; +*) case "$sig_num_init" in + ''|*,*) doinit=yes ;; + esac ;; +esac +case "$doinit" in +yes) echo "Generating a list of signal names and numbers..." >&4 . ./signal_cmd sig_name=`$awk '{printf "%s ", $1}' signal.lst` @@ -11207,7 +11176,9 @@ case "$sig_name_init" in sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } { printf "\"%s\", ", $1 } END { printf "0\n" }' signal.lst` - sig_num=`$awk 'BEGIN { printf "0, " } + sig_num=`$awk '{printf "%d ", $2}' signal.lst` + sig_num="0 $sig_num" + sig_num_init=`$awk 'BEGIN { printf "0, " } { printf "%d, ", $2} END { printf "0\n"}' signal.lst` ;; @@ -11410,6 +11381,10 @@ eval $setvar set locale.h i_locale eval $inhdr +: see if mach cthreads are available +set mach/cthreads.h i_machcthr +eval $inhdr + : see if this is a math.h system set math.h i_math eval $inhdr @@ -12325,7 +12300,6 @@ d_pipe='$d_pipe' d_poll='$d_poll' d_portable='$d_portable' d_pthread_yield='$d_pthread_yield' -d_pthreads_created_joinable='$d_pthreads_created_joinable' d_pwage='$d_pwage' d_pwchange='$d_pwchange' d_pwclass='$d_pwclass' @@ -12486,6 +12460,7 @@ i_grp='$i_grp' i_inttypes='$i_inttypes' i_limits='$i_limits' i_locale='$i_locale' +i_machcthr='$i_machcthr' i_malloc='$i_malloc' i_math='$i_math' i_memory='$i_memory' @@ -12656,6 +12631,7 @@ shsharp='$shsharp' sig_name='$sig_name' sig_name_init='$sig_name_init' sig_num='$sig_num' +sig_num_init='$sig_num_init' signal_t='$signal_t' sitearch='$sitearch' sitearchexp='$sitearchexp' @@ -1068,6 +1068,7 @@ t/op/each.t See if hash iterators work t/op/eval.t See if eval operator works t/op/exec.t See if exec and system work t/op/exp.t See if math functions work +t/op/filetest.t See if file tests work t/op/flip.t See if range operator works t/op/fork.t See if fork works t/op/glob.t See if <*> works diff --git a/Makefile.SH b/Makefile.SH index 24016d9e77..13f553da62 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -659,7 +659,7 @@ $define) xxx='' echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4 case "$osname" in -os390) +os390|posix-bc) rm -f y.tab.c y.tab.h yacc -d perly.y >/dev/null 2>&1 if cmp -s y.tab.c perly.c; then @@ -694,7 +694,14 @@ os390) fi cd x2p rm -f y.tab.c - yacc a2p.y >/dev/null 2>&1 + case "$osname" in + os390) + yacc -d a2p.y >/dev/null 2>&1 + ;; + *) # e.g. posix-bc + yacc a2p.y >/dev/null 2>&1 + ;; + esac if cmp -s y.tab.c a2p.c then rm -f y.tab.c @@ -719,6 +726,9 @@ os390) vmesa) # Do nothing in VM/ESA. ;; +*) + echo "'$osname' is an EBCDIC system I don't know well." >&4 + ;; esac case "$xxx" in '') echo "No parser files were regenerated. That's okay." >&2 ;; diff --git a/config_h.SH b/config_h.SH index 264c54db09..bfdb62a8a7 100644 --- a/config_h.SH +++ b/config_h.SH @@ -1869,7 +1869,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * the sig_name list. */ #define SIG_NAME $sig_name_init /**/ -#define SIG_NUM $sig_num /**/ +#define SIG_NUM $sig_num_init /**/ /* VOIDFLAGS: * This symbol indicates how much support of the void type is given by this @@ -2286,11 +2286,11 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define SCHED_YIELD $sched_yield /**/ #$d_sched_yield HAS_SCHED_YIELD /**/ -/* PTHREADS_CREATED_JOINABLE: - * This symbol, if defined, indicates that pthreads are created - * in the joinable (aka undetached) state. +/* I_MACH_CTHREADS: + * This symbol, if defined, indicates to the C program that it should + * include <mach/cthreads.h>. */ -#$d_pthreads_created_joinable PTHREADS_CREATED_JOINABLE /**/ +#$i_machcthr I_MACH_CTHREADS /**/ /* MULTIPLICITY: * This symbol, if defined, indicates that Perl should @@ -309,12 +309,6 @@ register struct op *op asm(stringify(OP_IN_REGISTER)); # include <pthread.h> #endif -/* HP-UX 10.X CMA (Common Multithreaded Architecure) insists that - pthread.h must be included before all other header files. -*/ -#if defined(USE_THREADS) && defined(PTHREAD_H_FIRST) -# include <pthread.h> -#endif #ifndef _TYPES_ /* If types.h defines this it's easy. */ # ifndef major /* Does everyone's types.h define this? */ # include <sys/types.h> @@ -1381,17 +1375,22 @@ typedef I32 (*filter_t) _((int, SV *, int)); # ifdef OS2 # include "os2thread.h" # else -# include <pthread.h> -typedef pthread_t perl_os_thread; -typedef pthread_mutex_t perl_mutex; -typedef pthread_cond_t perl_cond; -typedef pthread_key_t perl_key; +# ifdef I_MACH_CTHREADS +typedef cthread_t perl_os_thread; +typedef mutex_t perl_mutex; +typedef condition_t perl_cond; +typedef void * perl_key; +# else /* Posix threads */ +# include <pthread.h> +typedef pthread_t perl_os_thread; +typedef pthread_mutex_t perl_mutex; +typedef pthread_cond_t perl_cond; +typedef pthread_key_t perl_key; +# endif /* I_MACH_CTHREADS */ # endif /* OS2 */ # endif /* WIN32 */ # endif /* FAKE_THREADS */ #endif /* USE_THREADS */ - - #ifdef VMS # define STATUS_NATIVE PL_statusvalue_vms diff --git a/perly_c.diff b/perly_c.diff index f770e24794..11664b4551 100644 --- a/perly_c.diff +++ b/perly_c.diff @@ -1,5 +1,5 @@ -*** perly.c.orig Thu Sep 24 00:32:28 1998 ---- perly.c Thu Sep 24 00:18:13 1998 +*** perly.c.orig Tue Oct 27 12:59:58 1998 +--- perly.c Tue Oct 27 13:00:18 1998 *************** *** 7,10 **** --- 7,27 ---- @@ -25,22 +25,27 @@ static void dep(void) *************** -*** 12,86 **** +*** 12,91 **** deprecate("\"do\" to call subroutines"); } #line 30 "perly.y" -- #ifndef OEMVS -- #line 33 "perly.y" +- /* I sense a Big Blue pattern here... */ +- #if !defined(OEMVS) && !defined(__OPEN_VM) && !defined(POSIX_BC) +- #line 34 "perly.y" - typedef union { - I32 ival; - char *pval; - OP *opval; - GV *gvval; - } YYSTYPE; -- #line 41 "perly.y" -- #endif /* OEMVS */ -- #line 27 "y.tab.c" +- #line 42 "perly.y" +- #endif /* !OEMVS && !__OPEN_VM && !POSIX_BC */ +- +- #ifdef USE_PURE_BISON +- #define YYLEX_PARAM (&yychar) +- #endif +- #line 32 "y.tab.c" - #define WORD 257 - #define METHOD 258 - #define FUNCMETH 259 @@ -110,7 +115,7 @@ #define YYERRCODE 256 short yylhs[] = { -1, *************** -*** 1337,1365 **** +*** 1342,1370 **** #endif #endif - int yydebug; @@ -124,9 +129,9 @@ - short yyss[YYSTACKSIZE]; - YYSTYPE yyvs[YYSTACKSIZE]; - #define yystacksize YYSTACKSIZE - #line 643 "perly.y" + #line 648 "perly.y" /* PROGRAM */ -! #line 1353 "y.tab.c" +! #line 1358 "y.tab.c" #define YYABORT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab @@ -143,9 +148,9 @@ --- 1286,1350 ---- #endif #endif - #line 643 "perly.y" + #line 648 "perly.y" /* PROGRAM */ -! #line 1353 "perly.c" +! #line 1358 "perly.c" #define YYABORT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab @@ -207,7 +212,7 @@ if (yys = getenv("YYDEBUG")) { *************** -*** 1374,1377 **** +*** 1379,1382 **** --- 1359,1372 ---- yychar = (-1); @@ -224,20 +229,7 @@ yyssp = yyss; yyvsp = yyvs; *************** -*** 1389,1393 **** - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; -! printf("yydebug: state %d, reading %d (%s)\n", yystate, - yychar, yys); - } ---- 1384,1388 ---- - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; -! PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n", yystate, - yychar, yys); - } -*************** -*** 1399,1408 **** +*** 1404,1413 **** #if YYDEBUG if (yydebug) ! printf("yydebug: state %d, shifting to state %d\n", @@ -274,7 +266,7 @@ } *++yyssp = yystate = yytable[yyn]; *************** -*** 1440,1449 **** +*** 1445,1454 **** #if YYDEBUG if (yydebug) ! printf("yydebug: state %d, error recovery shifting\ @@ -312,7 +304,7 @@ } *++yyssp = yystate = yytable[yyn]; *************** -*** 1455,1460 **** +*** 1460,1465 **** #if YYDEBUG if (yydebug) ! printf("yydebug: error recovery discarding state %d\n", @@ -328,7 +320,7 @@ #endif if (yyssp <= yyss) goto yyabort; *************** -*** 1473,1478 **** +*** 1478,1483 **** if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; ! printf("yydebug: state %d, error recovery discards token %d (%s)\n", @@ -344,7 +336,7 @@ } #endif *************** -*** 1483,1487 **** +*** 1488,1492 **** #if YYDEBUG if (yydebug) ! printf("yydebug: state %d, reducing by rule %d (%s)\n", @@ -357,20 +349,20 @@ yystate, yyn, yyrule[yyn]); #endif *************** -*** 2267,2271 **** +*** 2272,2276 **** { yyval.opval = yyvsp[0].opval; } break; -! #line 2270 "y.tab.c" +! #line 2275 "y.tab.c" } yyssp -= yym; --- 2293,2297 ---- { yyval.opval = yyvsp[0].opval; } break; -! #line 2270 "perly.c" +! #line 2275 "perly.c" } yyssp -= yym; *************** -*** 2277,2282 **** +*** 2282,2287 **** #if YYDEBUG if (yydebug) ! printf("yydebug: after reduction, shifting from state 0 to\ @@ -386,7 +378,7 @@ #endif yystate = YYFINAL; *************** -*** 2292,2296 **** +*** 2297,2301 **** if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; ! printf("yydebug: state %d, reading %d (%s)\n", @@ -399,7 +391,7 @@ YYFINAL, yychar, yys); } *************** -*** 2307,2316 **** +*** 2312,2321 **** #if YYDEBUG if (yydebug) ! printf("yydebug: after reduction, shifting from state %d \ @@ -437,7 +429,7 @@ } *++yyssp = yystate; *************** -*** 2318,2325 **** +*** 2323,2330 **** goto yyloop; yyoverflow: ! yyerror("yacc stack overflow"); @@ -2469,6 +2469,13 @@ PP(pp_quotemeta) *d++ = *s++; } } + else { + while (len--) { + if (!isALNUM(*s)) + *d++ = '\\'; + *d++ = *s++; + } + } *d = '\0'; SvCUR_set(TARG, d - SvPVX(TARG)); (void)SvPOK_only(TARG); @@ -672,10 +672,11 @@ VIRTUAL void watch _((char** addr)); VIRTUAL I32 whichsig _((char* sig)); VIRTUAL int yyerror _((char* s)); #ifdef USE_PURE_BISON -VIRTUAL int yylex _((YYSTYPE* lvalp, int* lcharp)); +# define PERL_YYLEX_PARAM_DECL YYSTYPE *, int * #else -VIRTUAL int yylex _((void)); +# define PERL_YYLEX_PARAM_DECL #endif +VIRTUAL int yylex _((PERL_YYLEX_PARAM_DECL)); VIRTUAL int yyparse _((void)); VIRTUAL int yywarn _((char* s)); diff --git a/t/comp/require.t b/t/comp/require.t index 1959326281..5c41f5ccec 100755 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -35,9 +35,9 @@ print "ok ",$i++,"\n"; # compile-time failure in require do_require "1)\n"; -# bison says 'parser error' instead of 'syntax error', +# bison says 'parse error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'. -print "# $@\nnot " unless $@ =~ /(syntax|parser) error/i; +print "# $@\nnot " unless $@ =~ /(syntax|parse) error/mi; print "ok ",$i++,"\n"; # successful require diff --git a/t/io/pipe.t b/t/io/pipe.t index d89bad8c4f..08b312aec5 100755 --- a/t/io/pipe.t +++ b/t/io/pipe.t @@ -23,10 +23,9 @@ close PIPE; if ($^O eq 'vmesa') { # Doesn't work, yet. - print "ok 3\n"; - print "ok 4\n"; - print "ok 5\n"; - print "ok 6\n"; + for (3..6) { + print "ok $_ # skipped\n"; + } } else { if (open(PIPE, "-|")) { while(<PIPE>) { @@ -82,10 +81,10 @@ print "ok 8\n"; # STDOUT. Someone should modify tests #9 to #12 to work with VMS. if ($^O eq 'VMS') { - print "ok 9\n"; - print "ok 10\n"; - print "ok 11\n"; - print "ok 12\n"; + print "ok 9 # skipped\n"; + print "ok 10 # skipped\n"; + print "ok 11 # skipped\n"; + print "ok 12 # skipped\n"; exit; } @@ -95,7 +94,7 @@ if ($Config{d_sfio} || $^O eq 'machten' || $^O eq 'beos' || $^O eq 'posix-bc') { # but won't write to broken pipes, so nothing's pending at close. # BeOS will not write to broken pipes, either. # Nor does POSIX-BC. - print "ok 9\n"; + print "ok 9 # skipped\n"; } else { local $SIG{PIPE} = 'IGNORE'; @@ -112,9 +111,9 @@ else { if ($^O eq 'vmesa') { # These don't work, yet. - print "ok 10\n"; - print "ok 11\n"; - print "ok 12\n"; + print "ok 10 # skipped\n"; + print "ok 11 # skipped\n"; + print "ok 12 # skipped\n"; exit; } diff --git a/t/op/filetest.t b/t/op/filetest.t new file mode 100644 index 0000000000..d1332f0299 --- /dev/null +++ b/t/op/filetest.t @@ -0,0 +1,42 @@ +#!./perl + +# There are few filetest operators that are portable enough to test. +# See pod/perlport.pod for details. + +BEGIN { + chdir 't' if -d 't'; +} + +print "1..10\n"; + +print "not " unless -d 'op'; +print "ok 1\n"; + +print "not " unless -f 'TEST'; +print "ok 2\n"; + +print "not " if -f 'op'; +print "ok 3\n"; + +print "not " if -d 'TEST'; +print "ok 4\n"; + +print "not " unless -r 'TEST'; +print "ok 5\n"; + +print "not " if -w 'TEST'; +print "ok 6\n"; + +# Scripts are not -x everywhere. + +print "not " unless -r 'op'; +print "ok 7\n"; + +print "not " unless -w 'op'; +print "ok 8\n"; + +print "not " unless -x 'op'; # Hohum. Are directories -x everywhere? +print "ok 9\n"; + +print "not " unless "@{[grep -r, qw(foo io noo op zoo)]}" eq "io op"; +print "ok 10\n"; diff --git a/t/op/groups.t b/t/op/groups.t index f6f5ba252c..55cf4de4fb 100755 --- a/t/op/groups.t +++ b/t/op/groups.t @@ -1,9 +1,8 @@ #!./perl -if (! -x ($groups = '/usr/ucb/groups') && - ! -x ($groups = '/usr/bin/groups') && - ! -x ($groups = '/bin/groups') -) { +$ENV{PATH} = '/bin:/usr/bin:/usr/ucb:/usr/xpg4/bin'; + +unless (($groups = `(id -Gn || groups) 2>/dev/null`) ne '') { print "1..0\n"; exit 0; } @@ -27,13 +26,13 @@ for (split(' ', $()) { } } -if ($^O eq "uwin") { +if ($^O eq "uwin") { # Or anybody else who can have spaces in group names. $gr1 = join(' ', grep(!$did{$_}++, sort split(' ', join(' ', @gr)))); } else { $gr1 = join(' ', sort @gr); } -$gr2 = join(' ', grep(!$basegroup{$_}++, sort split(' ',`$groups`))); +$gr2 = join(' ', grep(!$basegroup{$_}++, sort split(' ',$groups))); if ($gr1 eq $gr2) { print "ok 1\n"; diff --git a/t/op/misc.t b/t/op/misc.t index b924f89847..a8ba4c89ef 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -36,9 +36,9 @@ for (@prgs){ $status = $?; $results = `$CAT $tmpfile`; $results =~ s/\n+$//; -# bison says 'parser error' instead of 'syntax error', +# bison says 'parse error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'. - $results =~ s/^(syntax|parser) error/\L$1 error/i; + $results =~ s/^(syntax|parse) error/syntax error/mi; $expected =~ s/\n+$//; if ( $results ne $expected){ print STDERR "PROG: $switch\n$prog\n"; diff --git a/t/pragma/subs.t b/t/pragma/subs.t index 58b53ae293..4a6f09b639 100755 --- a/t/pragma/subs.t +++ b/t/pragma/subs.t @@ -55,9 +55,9 @@ for (@prgs){ # allow expected output to be written as if $prog is on STDIN $results =~ s/tmp\d+/-/g; $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS; # clip off DCL status msg -# bison says 'parser error' instead of 'syntax error', +# bison says 'parse error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'. - $results =~ s/^(syntax|parser) error/\L$1 error/i; + $results =~ s/^(syntax|parse) error/syntax error/mi; $expected =~ s/\n+$//; my $prefix = ($results =~ s/^PREFIX\n//) ; if ( $results =~ s/^SKIPPED\n//) { diff --git a/t/pragma/warning.t b/t/pragma/warning.t index 2e88311c6c..cc4c2dd975 100755 --- a/t/pragma/warning.t +++ b/t/pragma/warning.t @@ -85,6 +85,9 @@ for (@prgs){ # allow expected output to be written as if $prog is on STDIN $results =~ s/tmp\d+/-/g; $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS; # clip off DCL status msg +# bison says 'parse error' instead of 'syntax error', +# various yaccs may or may not capitalize 'syntax'. + $results =~ s/^(syntax|parse) error/syntax error/mi; $expected =~ s/\n+$//; my $prefix = ($results =~ s/^PREFIX\n//) ; # any special options? (OPTIONS foo bar zap) @@ -50,6 +50,68 @@ struct perl_thread *getTHR _((void)); # define PTHREAD_ATTR_SETDETACHSTATE(a,s) pthread_attr_setdetachstate(a,s) #endif +#ifdef I_MACH_CTHREADS + +/* cthreads interface */ + +/* #include <mach/cthreads.h> is in perl.h #ifdef I_MACH_CTHREADS */ + +#define MUTEX_INIT(m) \ + STMT_START { \ + *m = mutex_alloc(); \ + if (*m) { \ + mutex_init(*m); \ + } else { \ + croak("panic: MUTEX_INIT"); \ + } \ + } STMT_END + +#define MUTEX_LOCK(m) mutex_lock(*m) +#define MUTEX_UNLOCK(m) mutex_unlock(*m) +#define MUTEX_DESTROY(m) \ + STMT_START { \ + mutex_free(*m); \ + *m = 0; \ + } STMT_END + +#define COND_INIT(c) \ + STMT_START { \ + *c = condition_alloc(); \ + if (*c) { \ + condition_init(*c); \ + } else { \ + croak("panic: COND_INIT"); \ + } \ + } STMT_END + +#define COND_SIGNAL(c) condition_signal(*c) +#define COND_BROADCAST(c) condition_broadcast(*c) +#define COND_WAIT(c, m) condition_wait(*c, *m) +#define COND_DESTROY(c) \ + STMT_START { \ + condition_free(*c); \ + *c = 0; \ + } STMT_END + +#define THREAD_CREATE(thr, f) (thr->self = cthread_fork(f, thr), 0) +#define THREAD_POST_CREATE(thr) + +#define THREAD_RET_TYPE any_t +#define THREAD_RET_CAST(x) ((any_t) x) + +#define DETACH(t) cthread_detach(t->self) +#define JOIN(t, avp) (*(avp) = (AV *)cthread_join(t->self)) + +#define SET_THR(thr) cthread_set_data(cthread_self(), thr) +#define THR cthread_data(cthread_self()) + +#define INIT_THREADS cthread_init() +#define YIELD cthread_yield() +#define ALLOC_THREAD_KEY +#define SET_THREAD_SELF(thr) (thr->self = cthread_self()) + +#endif /* I_MACH_CTHREADS */ + #ifndef YIELD # ifdef SCHED_YIELD # define YIELD SCHED_YIELD @@ -66,16 +128,14 @@ struct perl_thread *getTHR _((void)); # endif #endif -#ifdef PTHREADS_CREATED_JOINABLE +#if !defined(ATTR_JOINABLE) && defined(PTHREAD_CREATE_JOINABLE) # define ATTR_JOINABLE PTHREAD_CREATE_JOINABLE -#else -# ifdef PTHREAD_CREATE_UNDETACHED -# define ATTR_JOINABLE PTHREAD_CREATE_UNDETACHED -# else -# ifdef __UNDETACHED -# define ATTR_JOINABLE __UNDETACHED -# endif -# endif +#endif +#if !defined(ATTR_JOINABLE) && defined(PTHREAD_CREATE_UNDETACHED) +# define ATTR_JOINABLE PTHREAD_CREATE_UNDETACHED +#endif +#if !defined(ATTR_JOINABLE) && defined(__UNDETACHED) +# define ATTR_JOINABLE __UNDETACHED #endif #ifndef MUTEX_INIT @@ -112,15 +112,15 @@ static char ident_too_long[] = "Identifier too long"; #ifdef USE_PURE_BISON YYSTYPE* yylval_pointer = NULL; int* yychar_pointer = NULL; -#ifdef EMBED -#undef yylval -#undef yychar -#endif -#define yylval (*yylval_pointer) -#define yychar (*yychar_pointer) -#define YYLEXPARAM yylval_pointer,yychar_pointer +# ifdef EMBED +# undef yylval +# undef yychar +# endif +# define yylval (*yylval_pointer) +# define yychar (*yychar_pointer) +# define PERL_YYLEX_PARAM yylval_pointer,yychar_pointer #else -#define YYLEXPARAM +# define PERL_YYLEX_PARAM #endif #include "keywords.h" @@ -798,7 +798,7 @@ sublex_done(void) if (PL_lex_casemods) { /* oops, we've got some unbalanced parens */ PL_lex_state = LEX_INTERPCASEMOD; - return yylex(YYLEXPARAM); + return yylex(PERL_YYLEX_PARAM); } /* Is there a right-hand side to take care of? */ @@ -1585,12 +1585,7 @@ filter_gets(register SV *sv, register PerlIO *fp, STRLEN append) if we already built the token before, use it. */ -int yylex -#ifdef USE_PURE_BISON -(YYSTYPE* lvalp, int* lcharp) -#else -(void) -#endif +int yylex(PERL_YYLEX_PARAM_DECL) { dTHR; register char *s; @@ -1742,7 +1737,7 @@ int yylex if (PL_bufptr != PL_bufend) PL_bufptr += 2; PL_lex_state = LEX_INTERPCONCAT; - return yylex(YYLEXPARAM); + return yylex(PERL_YYLEX_PARAM); } else { s = PL_bufptr + 1; @@ -1786,7 +1781,7 @@ int yylex Aop(OP_CONCAT); } else - return yylex(YYLEXPARAM); + return yylex(PERL_YYLEX_PARAM); } case LEX_INTERPPUSH: @@ -1819,7 +1814,7 @@ int yylex s = PL_bufptr; Aop(OP_CONCAT); } - return yylex(YYLEXPARAM); + return yylex(PERL_YYLEX_PARAM); case LEX_INTERPENDMAYBE: if (intuit_more(PL_bufptr)) { @@ -1868,11 +1863,11 @@ int yylex Aop(OP_CONCAT); else { PL_bufptr = s; - return yylex(YYLEXPARAM); + return yylex(PERL_YYLEX_PARAM); } } - return yylex(YYLEXPARAM); + return yylex(PERL_YYLEX_PARAM); case LEX_FORMLINE: PL_lex_state = LEX_NORMAL; s = scan_formline(PL_bufptr); @@ -2152,7 +2147,7 @@ int yylex if (PL_lex_formbrack && PL_lex_brackets <= PL_lex_formbrack) { PL_bufptr = s; PL_lex_state = LEX_FORMLINE; - return yylex(YYLEXPARAM); + return yylex(PERL_YYLEX_PARAM); } goto retry; case '\r': @@ -2176,7 +2171,7 @@ int yylex if (PL_lex_formbrack && PL_lex_brackets <= PL_lex_formbrack) { PL_bufptr = s; PL_lex_state = LEX_FORMLINE; - return yylex(YYLEXPARAM); + return yylex(PERL_YYLEX_PARAM); } } else { @@ -2513,7 +2508,7 @@ int yylex if (PL_lex_fakebrack) { PL_lex_state = LEX_INTERPEND; PL_bufptr = s; - return yylex(YYLEXPARAM); /* ignore fake brackets */ + return yylex(PERL_YYLEX_PARAM); /* ignore fake brackets */ } if (*s == '-' && s[1] == '>') PL_lex_state = LEX_INTERPENDMAYBE; @@ -2524,7 +2519,7 @@ int yylex if (PL_lex_brackets < PL_lex_fakebrack) { PL_bufptr = s; PL_lex_fakebrack = 0; - return yylex(YYLEXPARAM); /* ignore fake brackets */ + return yylex(PERL_YYLEX_PARAM); /* ignore fake brackets */ } force_next('}'); TOKEN(';'); diff --git a/vmesa/Makefile b/vmesa/Makefile index 28c1265849..d06a2da078 100644 --- a/vmesa/Makefile +++ b/vmesa/Makefile @@ -3,13 +3,13 @@ CCCMD=`sh $(shellflags) ../cflags $@` all : vm perl depend : -;cd ..; $(MAKE) depend + cd .. && $(MAKE) depend vm : vmesa.o -;cp vmesa.o ../ + cp vmesa.o ../vmesa.o perl : -;cd ..; $(MAKE) + cd .. && $(MAKE) vmesa.o : vmesa.c -;$(CCCMD) vmesa.c + $(CCCMD) vmesa.c |