perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject Re: ExtUtils::XSBuilder patches
Date Sun, 16 Mar 2003 09:01:56 GMT
Angus,

thanks for the patches. I currently on the CeBit in Hannover, so I can't
check your patches against my version of XSBuilder. I will do this as soon
as I am back and send you comments, if I have any

Gerald

--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   Besuchen Sie uns auf der CeBIT vom 12. - 19. März 2003
|   Messe Hannover * Halle 17 * Stand F 36
|   http://www.cebit.de/
|
+-------------------------------------------------------------

----- Original Message -----
From: "Angus Lees" <gus@debian.org>
To: <embperl@perl.apache.org>
Sent: Sunday, March 16, 2003 7:25 AM
Subject: ExtUtils::XSBuilder patches


>
> some patches accumulated in packaging and using ExtUtils::XSBuilder:
>
> make pod2man happier:
>
> --- libextutils-xsbuilder-perl-0.23.orig/XSBuilder.pod
> +++ libextutils-xsbuilder-perl-0.23/XSBuilder.pod
> @@ -1,6 +1,8 @@
> +=head1 NAME
>
> +ExtUtils::XSBuilder - Automatic XS glue code generation
>
> -=head1 Basics
> +=head1 DESCRIPTION
>
>  ExtUtils::XSBuilder is a set modules to parse C header files and create
XS
>  glue code and documentation out of it. Idealy this allows to "write" an
>
>
>
> CHAR/U_CHAR (_types.map) null_type.
>
> extra parentheses around mg_find to avoid "Assignment used as
> comparison" gcc warning.
>
> explicit $type casts to avoid compiler warning when (eg) using SVPTR
> for coderefs (CV*).
>
> --- libextutils-xsbuilder-perl-0.23.orig/XSBuilder/TypeMap.pm
> +++ libextutils-xsbuilder-perl-0.23/XSBuilder/TypeMap.pm
> @@ -165,6 +165,9 @@
>      if ($class =~ /^[INU]V/) {
>          return '0';
>      }
> +    elsif ($class =~ /^(U_)?CHAR$/) {
> +        return '0'; # xsubpp seems to mangle q{'\0'}
> +    }
>      else {
>          return 'NULL';
>      }
> @@ -795,7 +798,7 @@
>              'INPUT' =>
>  q[    {
>      MAGIC * mg ;
> -    if (mg = mg_find (SvRV($arg), '~'))
> +    if ((mg = mg_find (SvRV($arg), '~')))
>          $var = *(($type *)(mg -> mg_ptr)) ;
>      else
>          croak (\"$var is not of type $type\") ;
> @@ -846,17 +849,17 @@
>          'T_AVREF' =>
>              {
>              'OUTPUT' => '        $arg = SvREFCNT_inc
(epxs_AVREF_2obj($var));',
> -            'INPUT'  => '        $var = epxs_sv2_AVREF($arg)',
> +            'INPUT'  => '        $var = ($type) epxs_sv2_AVREF($arg)',
>              },
>          'T_HVREF' =>
>              {
>              'OUTPUT' => '        $arg = SvREFCNT_inc
(epxs_HVREF_2obj($var));',
> -            'INPUT'  => '        $var = epxs_sv2_HVREF($arg)',
> +            'INPUT'  => '        $var = ($type) epxs_sv2_HVREF($arg)',
>              },
>          'T_SVPTR' =>
>              {
>              'OUTPUT' => '        $arg = SvREFCNT_inc
(epxs_SVPTR_2obj($var));',
> -            'INPUT'  => '        $var = epxs_sv2_SVPTR($arg)',
> +            'INPUT'  => '        $var = ($type) epxs_sv2_SVPTR($arg)',
>              },
>          },
>      }
>
>
> retargs values are never passed to perl functions directly, so should
> use the C type, not the mapped perl class (avoids several compiler
> warnings where the types don't quite match. eg int <-> IV).  Also note
> that TypeMap->map_args has stripped a trailing * from
> pointer-to-pointer types:
>
> --- libextutils-xsbuilder-perl-0.23.orig/XSBuilder/WrapXS.pm
> +++ libextutils-xsbuilder-perl-0.23/XSBuilder/WrapXS.pm
> @@ -549,7 +549,8 @@
>        $name =~ /^DESTROY$/ ? 'void' : $func->{return_type};
>
>      my $retdecl = @$retargs?(join "\n",
> -      (map { my $type = $self -> cname($_->{class}) ; $type =~ s/\*$//; '
' . $type . " $_->{name};"} @$retargs),
> +      # TypeMap->map_args has already stripped a * from retargs
> +      (map { my $type = $_->{rtype} ; $type =~ s/^const\s+//; '    ' .
$type . " $_->{name};"} @$retargs),
>        #'    ' . $self -> cname($return_type) . ' RETVAL',
>        ''):'';
>
>
> --
>  - Gus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>


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


Mime
View raw message