perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/xs/Apache/Log Apache__Log.h
Date Tue, 26 Mar 2002 03:37:48 GMT
dougm       02/03/25 19:37:47

  Modified:    xs/Apache/Log Apache__Log.h
  Log:
  workaround win32/5.6.1 bug which crashes when using PL_sv_no with do_join
  
  Revision  Changes    Path
  1.9       +24 -6     modperl-2.0/xs/Apache/Log/Apache__Log.h
  
  Index: Apache__Log.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Log/Apache__Log.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Apache__Log.h	4 May 2001 06:31:37 -0000	1.8
  +++ Apache__Log.h	26 Mar 2002 03:37:47 -0000	1.9
  @@ -102,6 +102,27 @@
   #define mpxs_Apache__Server_log(sv) \
   mpxs_Apache__Log_log(aTHX_ sv, MP_LOG_SERVER)
   
  +static MP_INLINE SV *modperl_perl_do_join(pTHX_ SV **mark, SV **sp)
  +{
  +    SV *sv = newSV(0);
  +    SV *delim;
  +#ifdef WIN32
  +    /* XXX: using PL_sv_no crashes on win32 with 5.6.1 */
  +    delim = newSVpv("", 0);
  +#else
  +    delim = SvREFCNT_inc(&PL_sv_no);
  +#endif
  +
  +    do_join(sv, delim, mark, sp);
  +
  +    SvREFCNT_dec(delim);
  +
  +    return sv;
  +}
  +
  +#define my_do_join(m, s) \
  +   modperl_perl_do_join(aTHX_ (m), (s))
  +
   static XS(MPXS_Apache__Log_dispatch)
   {
       dXSARGS;
  @@ -115,8 +136,7 @@
       }
   
       if (items > 2) {
  -        msgsv = newSV(0);
  -        do_join(msgsv, &PL_sv_no, MARK+1, SP);
  +        msgsv = my_do_join(MARK+1, SP);
       }
       else {
           msgsv = ST(1);
  @@ -213,8 +233,7 @@
       status = (apr_status_t)SvIV(ST(4));
   
       if (items > 6) {
  -        msgsv = newSV(0);
  -        do_join(msgsv, &PL_sv_no, MARK+5, SP);
  +        msgsv = my_do_join(MARK+5, SP);
       }
       else {
           msgsv = ST(5);
  @@ -279,8 +298,7 @@
       }
   
       if (items > 1+i) {
  -        sv = newSV(0);
  -        do_join(sv, &PL_sv_no, MARK+i, SP); /* $sv = join '', @_[1..$#_] */
  +        sv = my_do_join(MARK+i, SP); /* $sv = join '', @_[1..$#_] */
           errstr = SvPV(sv,n_a);
       }
       else {
  
  
  

Mime
View raw message