This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
APItest.xs: Silence compiler warning
[perl5.git] / ext / XS-APItest / APItest.pm
index b95af26..2fda1fc 100644 (file)
@@ -1,10 +1,12 @@
 package XS::APItest;
 
-{ use 5.011001; }
+{ use 5.011001; } # 5.11 is a long long time ago... What gives with this?
 use strict;
 use warnings;
 use Carp;
 
+our $VERSION = '1.12';
+
 require XSLoader;
 
 # Export everything since these functions are only used by a test script
@@ -24,6 +26,8 @@ sub import {
            if ($sym_name =~ /::$/) {
                # Skip any subpackages that are clearly OO
                next if *{$glob}{HASH}{'new'};
+               # and any that have AUTOLOAD
+               next if *{$glob}{HASH}{AUTOLOAD};
                push @stashes, "$stash_name$sym_name", *{$glob}{HASH};
            } elsif (ref $glob eq 'SCALAR' || *{$glob}{CODE}) {
                if ($exports) {
@@ -36,7 +40,7 @@ sub import {
        }
     }
     foreach (keys %{$exports||{}}) {
-       next unless /\A(?:rpn|calcrpn|stufftest|swaptwostmts|looprest|scopelessblock|stmtasexpr|stmtsasexpr|loopblock|blockasexpr|swaplabel|labelconst|arrayfullexpr|arraylistexpr|arraytermexpr|arrayarithexpr|arrayexprflags)\z/;
+       next unless /\A(?:rpn|calcrpn|stufftest|swaptwostmts|looprest|scopelessblock|stmtasexpr|stmtsasexpr|loopblock|blockasexpr|swaplabel|labelconst|arrayfullexpr|arraylistexpr|arraytermexpr|arrayarithexpr|arrayexprflags|subsignature|DEFSV|with_vars|join_with_space)\z/;
        $^H{"XS::APItest/$_"} = 1;
        delete $exports->{$_};
     }
@@ -50,8 +54,6 @@ sub import {
     }
 }
 
-our $VERSION = '0.27';
-
 use vars '$WARNINGS_ON_BOOTSTRAP';
 use vars map "\$${_}_called_PP", qw(BEGIN UNITCHECK CHECK INIT END);
 
@@ -94,6 +96,9 @@ if ($WARNINGS_ON_BOOTSTRAP) {
     XSLoader::load();
 }
 
+# This XS function needs the lvalue attr applied.
+eval 'use attributes __PACKAGE__, \\&lv_temp_object, "lvalue"; 1' or die;
+
 1;
 __END__
 
@@ -209,15 +214,22 @@ correctly by C<printf>.
 
 Output is sent to STDOUT.
 
+=item B<filter>
+
+Installs a source filter that substitutes "e" for "o" (witheut regard fer
+what it might be medifying).
+
 =item B<call_sv>, B<call_pv>, B<call_method>
 
 These exercise the C calls of the same names. Everything after the flags
-arg is passed as the the args to the called function. They return whatever
+arg is passed as the args to the called function. They return whatever
 the C function itself pushed onto the stack, plus the return value from
 the function; for example
 
-    call_sv( sub { @_, 'c' }, G_ARRAY,  'a', 'b'); # returns 'a', 'b', 'c', 3
-    call_sv( sub { @_ },      G_SCALAR, 'a', 'b'); # returns 'b', 1
+    call_sv( sub { @_, 'c' }, G_ARRAY,  'a', 'b');
+    # returns 'a', 'b', 'c', 3
+    call_sv( sub { @_ },      G_SCALAR, 'a', 'b');
+    # returns 'b', 1
 
 =item B<eval_sv>
 
@@ -242,6 +254,10 @@ They are lexically scoped.
 
 =over
 
+=item DEFSV
+
+Behaves like C<$_>.
+
 =item rpn(EXPRESSION)
 
 This construct is a Perl expression.  I<EXPRESSION> must be an RPN