You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@locus.apache.org on 2000/03/02 21:21:07 UTC

cvs commit: modperl/src/modules/perl Apache.xs Constants.xs mod_perl.c mod_perl.h perl_config.c perl_util.c

dougm       00/03/02 12:21:07

  Modified:    .        Changes Makefile.PL
               src/modules/perl Apache.xs Constants.xs mod_perl.c
                        mod_perl.h perl_config.c perl_util.c
  Log:
  tweaks to compile/run with 5.5.670 + -Dusethreads
  
  Revision  Changes    Path
  1.383     +2 -0      modperl/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.382
  retrieving revision 1.383
  diff -u -r1.382 -r1.383
  --- Changes	2000/03/02 01:57:44	1.382
  +++ Changes	2000/03/02 20:21:00	1.383
  @@ -10,6 +10,8 @@
   
   =item 1.21_01-dev
   
  +tweaks to compile/run with 5.5.670 + -Dusethreads
  +
   $r->hostname now documented [Eric Cholet <ch...@logilune.com>]
   
   Apache::File methods are now documented 
  
  
  
  1.140     +9 -2      modperl/Makefile.PL
  
  Index: Makefile.PL
  ===================================================================
  RCS file: /home/cvs/modperl/Makefile.PL,v
  retrieving revision 1.139
  retrieving revision 1.140
  diff -u -r1.139 -r1.140
  --- Makefile.PL	2000/03/01 01:32:12	1.139
  +++ Makefile.PL	2000/03/02 20:21:00	1.140
  @@ -33,8 +33,15 @@
   } if $File::Copy::VERSION < 2.0;
   
   my $Is_dougm = (defined($ENV{USER}) && ($ENV{USER} eq "dougm"));
  -my $USE_THREADS = 
  -    (defined($Config{usethreads}) && ($Config{usethreads} eq "define"));
  +my $USE_THREADS;
  +
  +if ($] < 5.005_60) {
  +    $USE_THREADS = (defined($Config{usethreads}) && 
  +		    ($Config{usethreads} eq "define"));
  +}
  +else {
  +    $USE_THREADS = $Config{use5005threads} eq "define";
  +}
      
   require "./lib/mod_perl.pm";
   $VERSION = $mod_perl::VERSION = $mod_perl::VERSION;
  
  
  
  1.88      +1 -1      modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- Apache.xs	2000/03/02 00:51:17	1.87
  +++ Apache.xs	2000/03/02 20:21:03	1.88
  @@ -963,7 +963,7 @@
   #ifdef PERL_OBJECT
   	(void)(*CvXSUB(cv))(cv, pPerl); /* &Apache::write_client; */
   #else
  -	(void)(*CvXSUB(cv))(cv); /* &Apache::write_client; */
  +	(void)(*CvXSUB(cv))(aTHXo_ cv); /* &Apache::write_client; */
   #endif
   
   	if(IoFLAGS(GvIOp(defoutgv)) & IOf_FLUSH) /* if $| != 0; */
  
  
  
  1.19      +13 -1     modperl/src/modules/perl/Constants.xs
  
  Index: Constants.xs
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/Constants.xs,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Constants.xs	1999/12/21 21:01:07	1.18
  +++ Constants.xs	2000/03/02 20:21:03	1.19
  @@ -65,7 +65,17 @@
                     Nullop,
                     block_end(block_start(TRUE), newOP(OP_STUB,0)));
   }
  -   
  +
  +#ifdef newCONSTSUB
  +
  +#define my_newCONSTSUB(stash, name, sv) \
  +    if(!no_warn) no_warn = empty_anon_sub(); \
  +    SAVESPTR(warnhook); \
  +    warnhook = (SV*)no_warn; \
  +    newCONSTSUB(stash, name, sv)
  +
  +#else   
  +
   static void my_newCONSTSUB(HV *stash, char *name, SV *sv)
   {
   #ifdef dTHR
  @@ -99,6 +109,8 @@
       curstash = old_curstash;
       curcop->cop_line = oldline;
   }
  +
  +#endif
   
   static enum cmd_how autoload_args_how(char *name) {
       if (strEQ(name, "FLAG"))
  
  
  
  1.98      +12 -8     modperl/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- mod_perl.c	2000/03/01 01:48:59	1.97
  +++ mod_perl.c	2000/03/02 20:21:03	1.98
  @@ -386,8 +386,8 @@
       request_rec *r = perl_request_rec(NULL);
       if(r) 
   	sv_setpv(sv, r->filename);
  -    else if(strNE(SvPVX(GvSV(curcop->cop_filegv)), "-e"))
  -	sv_setsv(sv, GvSV(curcop->cop_filegv));
  +    else if(strNE(SvPVX(GvSV(CopFILEGV(curcop))), "-e"))
  +	sv_setsv(sv, GvSV(CopFILEGV(curcop)));
       else {
   	SV *file = perl_eval_pv("(caller())[1]",TRUE);
   	sv_setsv(sv, file);
  @@ -600,7 +600,11 @@
   # endif
   #endif
   
  +#ifndef perl_init_i18nl10n
       perl_init_i18nl10n(1);
  +#else
  +    /* 5.6 calls during perl_construct() */
  +#endif
   
       MP_TRACE_g(fprintf(stderr, "allocating perl interpreter..."));
       if((perl = perl_alloc()) == NULL) {
  @@ -1005,9 +1009,9 @@
   	MP_TRACE_g(fprintf(stderr, 
   			   "mod_perl: restoring SIG%s (%d) handler from: 0x%lx to: 0x%lx\n",
   			   my_signame(sigs[i]->signo), (int)sigs[i]->signo,
  -			   (unsigned long)Perl_rsignal_state(sigs[i]->signo),
  +			   (unsigned long)rsignal_state(sigs[i]->signo),
   			   (unsigned long)sigs[i]->h));
  -	Perl_rsignal(sigs[i]->signo, sigs[i]->h);
  +	rsignal(sigs[i]->signo, sigs[i]->h);
       }
   }
   
  @@ -1047,17 +1051,17 @@
   
   #ifdef PERL_STACKED_HANDLERS
       /* reset Apache->push_handlers, but don't clear ExitHandler */
  -#define CH_EXIT_KEY "PerlChildExitHandler", 20
  +#define CH_EXIT_KEY "PerlChildExitHandler"
       {
   	SV *exith = Nullsv;
  -	if(hv_exists(stacked_handlers, CH_EXIT_KEY)) {
  -	    exith = *hv_fetch(stacked_handlers, CH_EXIT_KEY, FALSE);
  +	if(hv_exists(stacked_handlers, CH_EXIT_KEY, 20)) {
  +	    exith = *hv_fetch(stacked_handlers, CH_EXIT_KEY, 20, FALSE);
               /* inc the refcnt since hv_clear will dec it */
   	    ++SvREFCNT(exith);
   	}
   	hv_clear(stacked_handlers);
   	if(exith) 
  -	    hv_store(stacked_handlers, CH_EXIT_KEY, exith, FALSE);
  +	    hv_store(stacked_handlers, CH_EXIT_KEY, 20, exith, FALSE);
       }
   
   #endif
  
  
  
  1.93      +14 -0     modperl/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.h,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- mod_perl.h	1999/12/30 20:33:20	1.92
  +++ mod_perl.h	2000/03/02 20:21:03	1.93
  @@ -104,6 +104,16 @@
   #include "apache_inc.h"
   #endif
   
  +#ifdef pTHX_
  +#define PERL_IS_5_6
  +#else
  +#define pTHX_
  +#define aTHXo_
  +#define CopFILEGV(cop) cop->cop_filegv
  +#define CopLINE(cop)   cop->cop_line
  +#define SAVECOPFILE(cop) SAVESPTR(CopFILEGV(curcop));
  +#define SAVECOPLINE(cop) SAVEI16(CopLINE(cop))
  +#endif
   
   #ifndef dTHR
   #define dTHR extern int errno
  @@ -1019,7 +1029,11 @@
   /* mod_perl prototypes */
   
   /* perlxsi.c */
  +#ifdef aTHX_
  +void xs_init (pTHX);
  +#else
   void xs_init (void);
  +#endif
   
   /* mod_perl.c */
   
  
  
  
  1.85      +3 -3      modperl/src/modules/perl/perl_config.c
  
  Index: perl_config.c
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/perl_config.c,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- perl_config.c	2000/03/02 01:10:27	1.84
  +++ perl_config.c	2000/03/02 20:21:04	1.85
  @@ -392,16 +392,16 @@
       cfg->setup_env = 0;
   
       cfg->sigsave = make_array(p, 1, sizeof(perl_request_sigsave *));
  +
       for (i=0; sigsave[i]; i++) {
   	perl_request_sigsave *sig = 
   	    (perl_request_sigsave *)pcalloc(p, sizeof(perl_request_sigsave));
  -	sig->signo = Perl_whichsig(sigsave[i]);
  -	sig->h =  Perl_rsignal_state(sig->signo);
  +	sig->signo = whichsig(sigsave[i]);
  +	sig->h = rsignal_state(sig->signo);
   	MP_TRACE_g(fprintf(stderr, 
   			   "mod_perl: saving SIG%s (%d) handler 0x%lx\n",
   			   sigsave[i], (int)sig->signo, (unsigned long)sig->h));
   	*(perl_request_sigsave **)push_array(cfg->sigsave) = sig;
  -
       }
   
       return cfg;
  
  
  
  1.34      +7 -7      modperl/src/modules/perl/perl_util.c
  
  Index: perl_util.c
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/perl_util.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- perl_util.c	1999/12/29 22:11:33	1.33
  +++ perl_util.c	2000/03/02 20:21:04	1.34
  @@ -754,10 +754,10 @@
   	char *tmp = errpv;
   	tmp += 3;
   #ifndef PERL_MARK_WHERE
  -	if(strNE(SvPVX(GvSV(curcop->cop_filegv)), "-e")) {
  +	if(strNE(SvPVX(GvSV(CopFILEGV(curcop))), "-e")) {
   	    SV *fake = newSV(0);
   	    sv_setpv(fake, ""); /* avoid -w warning */
  -	    sv_catpvf(fake, " at %_ line ", GvSV(curcop->cop_filegv));
  +	    sv_catpvf(fake, " at %_ line ", GvSV(CopFILEGV(curcop)));
   
   	    if(strnEQ(SvPVX(fake), tmp, SvCUR(fake))) 
   		/* $@ is nothing but 3 digit code and the mess die tacks on */
  @@ -838,19 +838,19 @@
       if(curcop->cop_line) {
   #if 0
   	fprintf(stderr, "already know where: %s line %d\n",
  -		SvPV(GvSV(curcop->cop_filegv),na), curcop->cop_line);
  +		SvPV(GvSV(CopFILEGV(curcop)),na), CopFILEGV(curcop));
   #endif
   	return;
       }
   
  -    SAVESPTR(curcop->cop_filegv);
  -    SAVEI16(curcop->cop_line);
  +    SAVECOPFILE(curcop);
  +    SAVECOPLINE(curcop);
   
       if(sub) 
   	name = perl_sv_name(sub);
   
  -    sv_setpv(GvSV(curcop->cop_filegv), "");
  -    sv_catpvf(GvSV(curcop->cop_filegv), "%s subroutine `%_'", where, name);
  +    sv_setpv(GvSV(CopFILEGV(curcop)), "");
  +    sv_catpvf(GvSV(CopFILEGV(curcop)), "%s subroutine `%_'", where, name);
       curcop->cop_line = 1;
   
       if(name)