Apart from being more consistent, this simplifies writing XS code
wrapping C++ classes into a nested Perl namespace (it reqquires only
a typedef for Foo__Bar rather than two, one for Foo_Bar and the other
for Foo::Bar).
Impact is likely to be minimmal: it will only affect classes:
- in C++ extensions (there is no way to make Foo::Bar *THIS compile in C)
- that use Foo::Bar only as a receiver (if they use it as a
parameter/return value the typedef is already there)
Given that a class is always used as the return valus in a normal
constructor, this case should be relatively rare.
given this Foo.xs file:
MODULE=Foo PACKAGE=Foo::Bar
TYPEMAP: <<EOT
TYPEMAP
Foo::Bar * T_PTRREF
EOT
Foo::Bar *
Foo::Bar::moo(Foo::Bar *foo)
the output of
perl -Ilib lib/ExtUtils/xsubpp -prototypes Foo.xs
| grep -A8 moo | head -n 10
changes from:
XS_EUPXS(XS_Foo__Bar_moo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Foo__Bar_moo)
{
dVAR; dXSARGS;
if (items != 2)
croak_xs_usage(cv, "THIS, foo");
{
Foo::Bar * THIS;
Foo__Bar * RETVAL;
Foo__Bar * foo;
to:
XS_EUPXS(XS_Foo__Bar_moo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Foo__Bar_moo)
{
dVAR; dXSARGS;
if (items != 2)
croak_xs_usage(cv, "THIS, foo");
{
Foo__Bar * THIS;
Foo__Bar * RETVAL;
Foo__Bar * foo;
our $VERSION;
BEGIN {
- $VERSION = '3.30';
+ $VERSION = '3.31';
}
use ExtUtils::ParseXS::Constants $VERSION;
use ExtUtils::ParseXS::CountLines $VERSION;
} );
}
else {
- print "\t$class *";
+ print "\t" . map_type($self, "$class *");
$self->{var_types}->{"THIS"} = "$class *";
$self->generate_init( {
type => "$class *",
use warnings;
use Symbol;
-our $VERSION = '3.30';
+our $VERSION = '3.31';
=head1 NAME
package ExtUtils::ParseXS::CountLines;
use strict;
-our $VERSION = '3.30';
+our $VERSION = '3.31';
our $SECTION_END_MARKER;
use strict;
use warnings;
-our $VERSION = '3.30';
+our $VERSION = '3.31';
=head1 NAME
use File::Spec;
use ExtUtils::ParseXS::Constants ();
-our $VERSION = '3.30';
+our $VERSION = '3.31';
our (@ISA, @EXPORT_OK);
@ISA = qw(Exporter);
use 5.006001;
use strict;
use warnings;
-our $VERSION = '3.30';
+our $VERSION = '3.31';
require ExtUtils::ParseXS;
require ExtUtils::ParseXS::Constants;
use 5.006001;
use strict;
use warnings;
-our $VERSION = '3.30';
+our $VERSION = '3.31';
use ExtUtils::Typemaps;
use 5.006001;
use strict;
use warnings;
-our $VERSION = '3.30';
+our $VERSION = '3.31';
=head1 NAME
use 5.006001;
use strict;
use warnings;
-our $VERSION = '3.30';
+our $VERSION = '3.31';
=head1 NAME
use warnings;
require ExtUtils::Typemaps;
-our $VERSION = '3.30';
+our $VERSION = '3.31';
=head1 NAME