perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: cvs commit: modperl-2.0/xs/Apache/SubProcess Apache__SubProcess.h
Date Fri, 12 Jul 2002 01:32:56 GMT
Doug MacEachern wrote:
> i don't think this will compile with httpd < 2.0.40-dev, will it?
> feel free to #ifndef foo #define foo for these macros, or whatever, so 
> long as it compiles with released versions of httpd.  thanks.

I thought of that, but why do we need to keep it compiling with httpd < 
2.0.40-dev? aren't people supposed to use 1.99_04 with 2.0.39? or are 
you talking in the case when 1.99_05 is released and 2.0.40 is not?

 From what I understood there are going to be changes in the apr_time_t 
representation and these wrappers are going to shield us from the 
internal changes. and if I'm correct the code is going to break in any 
case without these changes.

there are more changes with API renames coming affecting both httpd and 
apr (I think today, watch wrowe and thom's commits), should we also keep 
backwards compatibility for these?

In any case this should work, right?

#ifndef apr_time_sec
#define apr_time_sec(time) ((apr_int64_t)((time) / APR_USEC_PER_SEC))
#endif
#ifndef apr_time_from_sec
#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
#endif

where should I add these? should we have some file with all the temp 
workaround that we can nuke when the Apache-2.0 API is frozen?

too bad httpd/apr folks don't provide things like ppport.h which adjusts 
things for the older versions.

> On 11 Jul 2002 stas@apache.org wrote:
> 
> 
>>stas        2002/07/10 23:14:10
>>
>>  Modified:    xs       typemap
>>               xs/Apache/SubProcess Apache__SubProcess.h
>>  Log:
>>  use the new time conversion macros: apr_time_*
>>  
>>  Revision  Changes    Path
>>  1.9       +2 -2      modperl-2.0/xs/typemap
>>  
>>  Index: typemap
>>  ===================================================================
>>  RCS file: /home/cvs/modperl-2.0/xs/typemap,v
>>  retrieving revision 1.8
>>  retrieving revision 1.9
>>  diff -u -r1.8 -r1.9
>>  --- typemap	24 May 2002 04:42:57 -0000	1.8
>>  +++ typemap	11 Jul 2002 06:14:10 -0000	1.9
>>  @@ -15,7 +15,7 @@
>>   	sv_setiv($arg, PTR2IV($var));
>>   
>>   T_APR_TIME
>>  -	sv_setnv($arg, (NV)($var / APR_USEC_PER_SEC));
>>  +	sv_setnv($arg, (NV)(apr_time_sec($var)));
>>   
>>   T_UVOBJ
>>   	modperl_perl_sv_setref_uv(aTHX_ $arg, \"${ntype}\", (UV)$var);
>>  @@ -58,7 +58,7 @@
>>   	$var = INT2PTR($type,SvIV(SvROK($arg) ? SvRV($arg) : $arg))
>>   
>>   T_APR_TIME
>>  -	$var = (apr_time_t)(SvNV($arg) * APR_USEC_PER_SEC)
>>  +	$var = (apr_time_t)(apr_time_from_sec(SvNV($arg)))
>>   
>>   T_CHAR_LEN
>>           $var = (char *)SvPV($arg, ${var}_len)
>>  
>>  
>>  
>>  1.11      +1 -1      modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h
>>  
>>  Index: Apache__SubProcess.h
>>  ===================================================================
>>  RCS file: /home/cvs/modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h,v
>>  retrieving revision 1.10
>>  retrieving revision 1.11
>>  diff -u -r1.10 -r1.11
>>  --- Apache__SubProcess.h	15 Mar 2002 04:29:25 -0000	1.10
>>  +++ Apache__SubProcess.h	11 Jul 2002 06:14:10 -0000	1.11
>>  @@ -20,7 +20,7 @@
>>   
>>   #define SET_TIMEOUT(fp) \
>>       apr_file_pipe_timeout_set(fp, \
>>  -                              (int)(r->server->timeout * APR_USEC_PER_SEC))
>>  +                              (int)(apr_time_from_sec(r->server->timeout)))
>>   
>>   static int modperl_spawn_proc_prog(pTHX_
>>                                      request_rec *r,
>>  
>>  
>>  
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org



-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message