On Fri, 31 Oct 2003 23:26:31 +0100, Rafael Garcia-Suarez <rgarciasuarez@free.fr> wrote: >Jan Dubois wrote: >> >> Most of the changes in the attached patch are not applicable to the >> development branch except: >> >> * I fixed the preprocessor symbols used to define _random_retval: >> >> REENTRANT_PROTO_iS => REENTRANT_PROTO_I_iS >> REENTRANT_PROTO_lS => REENTRANT_PROTO_I_lS >> REENTRANT_PROTO_tS => REENTRANT_PROTO_I_St >> >> (Note: the last one also swapped "tS" -> "St"!) >> >> * The expression (PL_reentrant_retint > 0 && PL_reentrant_retint == ERANGE) >> can be simplified to just (PL_reentrant_retint == ERANGE) everywhere. >> >> Let me know if I should submit a patch with just these 2 changes for the >> development track. > >That would be much appreciated :) Ok, attached. I've only tested on a single platform though. Cheers, -Jan PS: Yes, I've noticed that I can optimize the 5.8.2 patch even further by moving the assignment to PL_reentrant_retint to the single case that needs it (already done in this patch). I'll send another 5.8.2 patch later tonight... --- reentr.orig Sun Apr 27 23:48:33 2003 +++ reentr.pl Sun Nov 02 20:41:06 2003 @@ -480,13 +480,13 @@ EOF } elsif ($1 eq 'random') { push @struct, <<EOF; -# if RANDOM_R_PROTO == REENTRANT_PROTO_iS +# if RANDOM_R_PROTO == REENTRANT_PROTO_I_iS int _${func}_retval; # endif -# if RANDOM_R_PROTO == REENTRANT_PROTO_lS +# if RANDOM_R_PROTO == REENTRANT_PROTO_I_lS long _${func}_retval; # endif -# if RANDOM_R_PROTO == REENTRANT_PROTO_tS +# if RANDOM_R_PROTO == REENTRANT_PROTO_I_St int32_t _${func}_retval; # endif EOF @@ -679,7 +679,6 @@ $w = ", $w" if length $v; } my $call = "${func}_r($v$w)"; - $call = "((PL_reentrant_retint = $call))" if $r eq 'I' && $func ne 'random'; push @wrap, <<EOF; # if !defined($func) && ${FUNC}_R_PROTO == REENTRANT_PROTO_$p EOF @@ -692,7 +691,7 @@ my $rv = $v ? ", $v" : ""; if ($r eq 'I') { push @wrap, <<EOF; -# define $func($v) ($call$test ? $true : (((PL_reentrant_retint > 0 && PL_reentrant_retint == ERANGE) || (errno == ERANGE)) ? Perl_reentrant_retry("$func"$rv) : 0)) +# define $func($v) ((PL_reentrant_retint = $call)$test ? $true : (((PL_reentrant_retint == ERANGE) || (errno == ERANGE)) ? Perl_reentrant_retry("$func"$rv) : 0)) EOF } else { push @wrap, <<EOF;Thread Previous | Thread Next