+3.14_03 - 2008-10-21
+
+ * fix C++ compilation issue with last release
+ (spotted by Nicholas Clark)
+ * added support for the following API
+ Perl_ppaddr_t
+ Perl_check_t
+ CPERLscope
+ (fixes CPAN #40078)
+
3.14_02 - 2008-10-12
* added support for the following API
#
################################################################################
#
-# $Revision: 61 $
+# $Revision: 62 $
# $Author: mhx $
-# $Date: 2008/10/12 13:54:21 +0200 $
+# $Date: 2008/10/21 23:12:30 +0200 $
#
################################################################################
#
#
################################################################################
#
-# $Revision: 61 $
+# $Revision: 62 $
# $Author: mhx $
-# $Date: 2008/10/12 13:54:21 +0200 $
+# $Date: 2008/10/21 23:12:30 +0200 $
#
################################################################################
#
use strict;
use vars qw($VERSION $data);
-$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.14_02 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
+$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.14_03 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
sub _init_data
{
%include version
+%include threads
+
%include limits
%include uv
%include variables
-%include threads
-
%include mPUSH
%include call
################################################################################
##
-## $Revision: 46 $
+## $Revision: 47 $
## $Author: mhx $
-## $Date: 2008/07/11 14:00:05 +0200 $
+## $Date: 2008/10/21 23:14:09 +0200 $
##
################################################################################
##
__UNDEFINED__ UTF8_MAXBYTES UTF8_MAXLEN
+__UNDEFINED__ CPERLscope(x) x
+
__UNDEFINED__ PERL_HASH(hash,str,len) \
STMT_START { \
const char *s_PeRlHaSh = str; \
# endif
#endif
+/* provide these typedefs for older perls */
+#if { VERSION < 5.9.3 }
+
+# ifdef ARGSproto
+typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
+# else
+typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
+# endif
+
+typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
+
+#endif
+
=xsmisc
XS(XS_Devel__PPPort_dXSTARG); /* prototype */
XPUSHs(x);
XSRETURN(1);
-=tests plan => 32
+void
+Perl_ppaddr_t(string)
+ char *string
+ PREINIT:
+ Perl_ppaddr_t lower;
+ PPCODE:
+ lower = PL_ppaddr[OP_LC];
+ PUSHMARK(SP);
+ mXPUSHs(newSVpv(string, 0));
+ PUTBACK;
+ ENTER;
+ (void)*(lower)(aTHXR);
+ SPAGAIN;
+ LEAVE;
+ XSRETURN(1);
+
+=tests plan => 33
use vars qw($my_sv @my_av %my_hv);
ok(Devel::PPPort::SVf(42), $] >= 5.004 ? '[42]' : '42');
ok(Devel::PPPort::SVf('abc'), $] >= 5.004 ? '[abc]' : 'abc');
+ok(&Devel::PPPort::Perl_ppaddr_t("FOO"), "foo");
+
################################################################################
##
-## $Revision: 4 $
+## $Revision: 5 $
## $Author: mhx $
-## $Date: 2008/01/04 13:10:54 +0100 $
+## $Date: 2008/10/21 23:14:47 +0200 $
##
################################################################################
##
=implementation
+#if { VERSION < 5.6.0 }
+# define D_PPP_CONSTPV_ARG(x) ((char *) (x))
+#else
+# define D_PPP_CONSTPV_ARG(x) (x)
+#endif
+
__UNDEFINED__ newSVpvn(data,len) ((data) \
? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
: newSV(0))
SV *
newSVpvn_flags(pTHX_ const char *s, STRLEN len, U32 flags)
{
- SV *sv = newSVpvn(s, len);
+ SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
SvFLAGS(sv) |= (flags & SVf_UTF8);
return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
}
################################################################################
##
-## $Revision: 17 $
+## $Revision: 18 $
## $Author: mhx $
-## $Date: 2008/10/12 20:53:47 +0200 $
+## $Date: 2008/10/21 23:15:31 +0200 $
##
################################################################################
##
count++; \
} STMT_END
-#if PERL_BCDVERSION < 0x5006000
+#if { VERSION < 5.004 }
+# define ppp_rsfp_t FILE *
+#else
+# define ppp_rsfp_t PerlIO *
+#endif
+
+#if { VERSION < 5.6.0 }
# define ppp_expect_t expectation
-#elif PERL_BCDVERSION < 0x5009005
+#elif { VERSION < 5.9.5 }
# define ppp_expect_t int
#else
# define ppp_expect_t U8
#endif
-#if PERL_BCDVERSION < 0x5009005
+#if { VERSION < 5.9.5 }
# define ppp_lex_state_t U32
#else
# define ppp_lex_state_t U8
RETVAL
SV *
-PL_rsfp()
- PREINIT:
- void * volatile my_rsfp;
- /* no pointer test, as we don't know the exact type */
- CODE:
- my_rsfp = PL_rsfp;
- RETVAL = newSViv(PL_rsfp != 0);
- PL_rsfp = my_rsfp;
- OUTPUT:
- RETVAL
-
-SV *
PL_tokenbuf()
CODE:
RETVAL = newSViv(PL_tokenbuf[0]);
ppp_PARSERVAR(ppp_expect_t, PL_expect);
ppp_PARSERVAR(line_t, PL_copline);
+ ppp_PARSERVAR(ppp_rsfp_t, PL_rsfp);
ppp_PARSERVAR(AV *, PL_rsfp_filters);
ppp_PARSERVAR(SV *, PL_linestr);
ppp_PARSERVAR(char *, PL_bufptr);
ok(!&Devel::PPPort::PL_sv_no());
ok(&Devel::PPPort::PL_na("abcd"), 4);
ok(&Devel::PPPort::PL_Sv(), "mhx");
-ok(defined &Devel::PPPort::PL_rsfp());
ok(defined &Devel::PPPort::PL_tokenbuf());
ok($] >= 5.009005 || &Devel::PPPort::PL_parser());
ok(&Devel::PPPort::PL_hexdigit() =~ /^[0-9a-zA-Z]+$/);
use List::Util qw(max);
use Config;
-my $VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.14_02 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
+my $VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.14_03 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' };
$| = 1;
my %OPT = (
require 'testutil.pl' if $@;
}
- if (32) {
+ if (33) {
load();
- plan(tests => 32);
+ plan(tests => 33);
}
}
ok(Devel::PPPort::SVf(42), $] >= 5.004 ? '[42]' : '42');
ok(Devel::PPPort::SVf('abc'), $] >= 5.004 ? '[abc]' : 'abc');
+ok(&Devel::PPPort::Perl_ppaddr_t("FOO"), "foo");
+
ok(!&Devel::PPPort::PL_sv_no());
ok(&Devel::PPPort::PL_na("abcd"), 4);
ok(&Devel::PPPort::PL_Sv(), "mhx");
-ok(defined &Devel::PPPort::PL_rsfp());
ok(defined &Devel::PPPort::PL_tokenbuf());
ok($] >= 5.009005 || &Devel::PPPort::PL_parser());
ok(&Devel::PPPort::PL_hexdigit() =~ /^[0-9a-zA-Z]+$/);