Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 826208 Details for
Bug 1032181
Templated types are causing "Could not find a typemap for C type"
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch that solves the issue
perl-ExtUtils-ParseXS-rt86367.patch (text/plain), 7.38 KB, created by
Miro Hrončok
on 2013-11-19 16:48:04 UTC
(
hide
)
Description:
Patch that solves the issue
Filename:
MIME Type:
Creator:
Miro Hrončok
Created:
2013-11-19 16:48:04 UTC
Size:
7.38 KB
patch
obsolete
>diff --git a/lib/ExtUtils/ParseXS.pm b/lib/ExtUtils/ParseXS.pm >index d50b501..a692ff8 100644 >--- a/lib/ExtUtils/ParseXS.pm >+++ b/lib/ExtUtils/ParseXS.pm >@@ -21,7 +21,6 @@ $VERSION = eval $VERSION if $VERSION =~ /_/; > use ExtUtils::ParseXS::Utilities qw( > standard_typemap_locations > trim_whitespace >- tidy_type > C_string > valid_proto_string > process_typemaps >@@ -323,7 +322,7 @@ EOM > } > > # extract return type, function name and arguments >- ($self->{ret_type}) = tidy_type($_); >+ ($self->{ret_type}) = ExtUtils::Typemaps::tidy_type($_); > my $RETVAL_no_return = 1 if $self->{ret_type} =~ s/^NO_OUTPUT\s+//; > > # Allow one-line ANSI-like declaration >@@ -1816,7 +1815,7 @@ sub generate_init { > > my $typemaps = $self->{typemap}; > >- $type = tidy_type($type); >+ $type = ExtUtils::Typemaps::tidy_type($type); > $self->report_typemap_failure($typemaps, $type), return > unless $typemaps->get_typemap(ctype => $type); > >@@ -1911,7 +1910,7 @@ sub generate_output { > > my $typemaps = $self->{typemap}; > >- $type = tidy_type($type); >+ $type = ExtUtils::Typemaps::tidy_type($type); > if ($type =~ /^array\(([^,]*),(.*)\)/) { > print "\t$arg = sv_newmortal();\n"; > print "\tsv_setpvn($arg, (char *)$var, $2 * sizeof($1));\n"; >diff --git a/lib/ExtUtils/ParseXS/Utilities.pm b/lib/ExtUtils/ParseXS/Utilities.pm >index d0089f8..d4cfb27 100644 >--- a/lib/ExtUtils/ParseXS/Utilities.pm >+++ b/lib/ExtUtils/ParseXS/Utilities.pm >@@ -13,7 +13,6 @@ our (@ISA, @EXPORT_OK); > @EXPORT_OK = qw( > standard_typemap_locations > trim_whitespace >- tidy_type > C_string > valid_proto_string > process_typemaps >@@ -175,45 +174,6 @@ sub trim_whitespace { > $_[0] =~ s/^\s+|\s+$//go; > } > >-=head2 C<tidy_type()> >- >-=over 4 >- >-=item * Purpose >- >-Rationalize any asterisks (C<*>) by joining them into bunches, removing >-interior whitespace, then trimming leading and trailing whitespace. >- >-=item * Arguments >- >- ($ret_type) = tidy_type($_); >- >-String to be cleaned up. >- >-=item * Return Value >- >-String cleaned up. >- >-=back >- >-=cut >- >-sub tidy_type { >- local ($_) = @_; >- >- # rationalise any '*' by joining them into bunches and removing whitespace >- s#\s*(\*+)\s*#$1#g; >- s#(\*+)# $1 #g; >- >- # change multiple whitespace into a single space >- s/\s+/ /g; >- >- # trim leading & trailing whitespace >- trim_whitespace($_); >- >- $_; >-} >- > =head2 C<C_string()> > > =over 4 >diff --git a/lib/ExtUtils/Typemaps.pm b/lib/ExtUtils/Typemaps.pm >index 2768ef0..9c4bc33 100644 >--- a/lib/ExtUtils/Typemaps.pm >+++ b/lib/ExtUtils/Typemaps.pm >@@ -344,7 +344,7 @@ sub remove_typemap { > my %args = @_; > $ctype = $args{ctype}; > die("Need ctype argument") if not defined $ctype; >- $ctype = _tidy_type($ctype); >+ $ctype = tidy_type($ctype); > } > else { > $ctype = $_[0]->tidy_ctype; >@@ -443,7 +443,7 @@ sub get_typemap { > my %args = @_; > my $ctype = $args{ctype}; > die("Need ctype argument") if not defined $ctype; >- $ctype = _tidy_type($ctype); >+ $ctype = tidy_type($ctype); > > my $index = $self->{typemap_lookup}{$ctype}; > return() if not defined $index; >@@ -860,7 +860,7 @@ sub validate { > my %args = @_; > > if ( exists $args{ctype} >- and exists $self->{typemap_lookup}{_tidy_type($args{ctype})} ) >+ and exists $self->{typemap_lookup}{tidy_type($args{ctype})} ) > { > die("Multiple definition of ctype '$args{ctype}' in TYPEMAP section"); > } >@@ -880,6 +880,40 @@ sub validate { > return 1; > } > >+=head2 tidy_type >+ >+Function to (heuristically) canonicalize a C type. Works to some >+degree with C++ types. >+ >+ $halfway_canonical_type = tidy_type($ctype); >+ >+Moved from C<ExtUtils::ParseXS>. >+ >+=cut >+ >+sub tidy_type { >+ local $_ = shift; >+ >+ # for templated C++ types, do some bit of flawed canonicalization >+ # wrt. templates at least >+ if (/[<>]/) { >+ s/\s*([<>])\s*/$1/g; >+ s/>>/> >/g; >+ } >+ >+ # rationalise any '*' by joining them into bunches and removing whitespace >+ s#\s*(\*+)\s*#$1#g; >+ s#(\*+)# $1 #g ; >+ >+ # trim leading & trailing whitespace >+ s/^\s+//; s/\s+$//; >+ >+ # change multiple whitespace into a single space >+ s/\s+/ /g; >+ >+ $_; >+} >+ > sub _parse { > my $self = shift; > my $stringref = shift; >@@ -969,25 +1003,6 @@ sub _parse { > return 1; > } > >-# taken from ExtUtils::ParseXS >-sub _tidy_type { >- local $_ = shift; >- >- # rationalise any '*' by joining them into bunches and removing whitespace >- s#\s*(\*+)\s*#$1#g; >- s#(\*+)# $1 #g ; >- >- # trim leading & trailing whitespace >- s/^\s+//; s/\s+$//; >- >- # change multiple whitespace into a single space >- s/\s+/ /g; >- >- $_; >-} >- >- >-# taken from ExtUtils::ParseXS > sub _valid_proto_string { > my $string = shift; > if ($string =~ /^$ExtUtils::ParseXS::Constants::PrototypeRegexp+$/o) { >diff --git a/lib/ExtUtils/Typemaps/Type.pm b/lib/ExtUtils/Typemaps/Type.pm >index 1b9f8ba..b6e982f 100644 >--- a/lib/ExtUtils/Typemaps/Type.pm >+++ b/lib/ExtUtils/Typemaps/Type.pm >@@ -53,7 +53,7 @@ sub new { > > $self->{xstype} = $args{xstype} if defined $args{xstype}; > $self->{ctype} = $args{ctype} if defined $args{ctype}; >- $self->{tidy_ctype} = ExtUtils::Typemaps::_tidy_type($self->{ctype}); >+ $self->{tidy_ctype} = ExtUtils::Typemaps::tidy_type($self->{ctype}); > $self->{proto} = $args{'prototype'} if defined $args{'prototype'}; > > return $self; >diff --git a/t/103-tidy_type.t b/t/103-tidy_type.t >index a043383..03a1389 100644 >--- a/t/103-tidy_type.t >+++ b/t/103-tidy_type.t >@@ -1,23 +1,23 @@ > #!/usr/bin/perl > use strict; > use warnings; >-use Test::More tests => 3; >+use Test::More; > use lib qw( lib ); >-use ExtUtils::ParseXS::Utilities qw( >- tidy_type >-); >- >-my $input; >+use ExtUtils::Typemaps; > >-$input = ' * ** '; >-is( tidy_type($input), '***', >- "Got expected value for '$input'" ); >- >-$input = ' * ** '; >-is( tidy_type($input), '***', >- "Got expected value for '$input'" ); >+my @tests = ( >+ [' * ** ', '***'], >+ [' * ** ', '***'], >+ [' * ** foobar * ', '*** foobar *'], >+ ['unsigned int', 'unsigned int'], >+ ['std::vector<int>', 'std::vector<int>'], >+ ['std::vector< unsigned int >', 'std::vector<unsigned int>'], >+ ['std::vector< vector<unsigned int> >', 'std::vector<vector<unsigned int> >'], >+ ['std::map< map <unsigned int, int>, int>', 'std::map<map<unsigned int, int>, int>'], >+); > >-$input = ' * ** foobar * '; >-is( tidy_type($input), '*** foobar *', >- "Got expected value for '$input'" ); >+plan tests => scalar(@tests); > >+foreach my $test (@tests) { >+ is(ExtUtils::Typemaps::tidy_type($test->[0]), $test->[1], "Tidying '$test->[0]'"); >+} >diff --git a/t/600-t-compat.t b/t/600-t-compat.t >index 1f22e40..20f2ce0 100644 >--- a/t/600-t-compat.t >+++ b/t/600-t-compat.t >@@ -11,7 +11,6 @@ use Test::More; > use ExtUtils::Typemaps; > use ExtUtils::ParseXS::Utilities qw( > C_string >- tidy_type > trim_whitespace > process_typemaps > ); >@@ -94,7 +93,7 @@ foreach my $test (@tests) { > } > > >-# The code below is a reproduction of what the pre-ExtUtils::Typemap >+# The code below is a reproduction of what the pre-ExtUtils::Typemaps > # typemap-parsing/handling code in ExtUtils::ParseXS looked like. For > # bug-compatibility, we want to produce the same data structures as that > # code as much as possible. >@@ -157,7 +156,7 @@ sub _process_single_typemap { > "TYPEMAP entry needs 2 or 3 columns\n" > ), > next; >- $type = tidy_type($type); >+ $type = ExtUtils::Typemaps::tidy_type($type); > $type_kind_ref->{$type} = $kind; > # prototype defaults to '$' > $proto = "\$" unless $proto;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1032181
:
826208
|
826591