develooper Front page | perl.perl5.porters | Postings from November 2003

Re: [perl #24468] 5.8.2: Interface cannot be compiled with C++

Thread Previous | Thread Next
From:
Jan Dubois
Date:
November 12, 2003 17:13
Subject:
Re: [perl #24468] 5.8.2: Interface cannot be compiled with C++
Message ID:
btl5rv0eefbttr5sp0i7hbn6mrt7l9gjem@4ax.com
On Wed, 12 Nov 2003 19:06:27 -0500, Chip Salzenberg <chip@pobox.com> wrote:

>According to Jan Dubois:
>> I guess that returning 0 as a pointer of the correct type is the problem.
>
>No, returning 0 is fine.  The problem is returning Perl_reentrant_retry(),
>which is of type void* (as the error messages said [*cough*]).  Is this

Actually, your bug report doesn't mention Perl_reentrant_retry() at all
as far as I can tell:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-11/msg00550.html

>usage new?  If not, why did 5.8.2 fail when 5.8.1 (or perhaps 5.8.0)
>worked?  (I ask only out of curiosity.)

Perl 5.8.1 uses this code only in the macro redefinitions of the functions.
If you are not calling any of the redefined functions, the macros are not
expanded and not checked for syntax problems.

In Perl 5.8.2 some of the redefinitions are implemented as static wrapper
functions to allow the introduction of a temporary variable.  These wrappers
will be syntax checked, even if they are never called and optimized away.

The wrappers will only be used outside the Perl core, and only if you are not
using GCC.  For GCC I'm using inline functions.

>In any case, we might well need something like this instead:

Yes, probably.  Why don't you actually try it out?  :)

Cheers,
-Jan


>Index: main/Apps/Gecko/src/Core/reentr.pl
>--- main/Apps/Gecko/src/Core/reentr.pl.~1~	Wed Nov 12 15:12:34 2003
>+++ main/Apps/Gecko/src/Core/reentr.pl	Wed Nov 12 15:12:34 2003
>@@ -695,7 +695,7 @@
> 		if ($func =~ /^get/) {
> 		    my $rv = $v ? ", $v" : "";
> 		    if ($r eq 'I') {
>-			$call = qq[((PL_REENTRANT_RETINT = $call)$test ? $true : (((PL_REENTRANT_RETINT == ERANGE) || (errno == ERANGE)) ? Perl_reentrant_retry("$func"$rv) : 0))];
>+			$call = qq[((PL_REENTRANT_RETINT = $call)$test ? $true : (((PL_REENTRANT_RETINT == ERANGE) || (errno == ERANGE)) ? ($seenm{$func}{$seenr{$func}})Perl_reentrant_retry("$func"$rv) : 0))];
> 			my $arg = join(", ", map { $seenm{$func}{substr($a,$_,1)}." ".$v[$_] } 0..$seenu{$func}-1);
> 			my $ret = $seenr{$func} eq 'V' ? "" : "return ";
> 			push @wrap, <<EOF;
>End of Patch.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About