From: Marcus Holland-Moritz Date: Wed, 8 Sep 2004 20:19:18 +0000 (+0000) Subject: Upgrade to Devel::PPPort 3.03. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4c28a9f9392ef0dd068270ebd8d19899d1903a2;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Devel::PPPort 3.03. p4raw-id: //depot/perl@23282 --- diff --git a/ext/Devel/PPPort/Changes b/ext/Devel/PPPort/Changes index ca0a6c0..e1addf8 100755 --- a/ext/Devel/PPPort/Changes +++ b/ext/Devel/PPPort/Changes @@ -1,3 +1,7 @@ +3.03 - 2004-09-08 + + * MY_CXT_CLONE was broken + 3.02 - 2004-09-08 * added support for the following API: diff --git a/ext/Devel/PPPort/META.yml b/ext/Devel/PPPort/META.yml index 638c7d8..c0e2f44 100644 --- a/ext/Devel/PPPort/META.yml +++ b/ext/Devel/PPPort/META.yml @@ -1,7 +1,7 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Devel-PPPort -version: 3.02 +version: 3.03 version_from: PPPort_pm.PL installdirs: perl requires: diff --git a/ext/Devel/PPPort/PPPort.pm b/ext/Devel/PPPort/PPPort.pm index 68a5b06..073f34e 100644 --- a/ext/Devel/PPPort/PPPort.pm +++ b/ext/Devel/PPPort/PPPort.pm @@ -873,7 +873,7 @@ require DynaLoader; use strict; use vars qw($VERSION @ISA $data); -$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.02 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; +$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.03 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; @ISA = qw(DynaLoader); @@ -4290,8 +4290,6 @@ DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv) #endif #endif -#ifndef START_MY_CXT - /* * Boilerplate macros for initializing and accessing interpreter-local * data from C. All statics in extensions should be reworked to use @@ -4314,6 +4312,8 @@ DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv) #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \ defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT) +#ifndef START_MY_CXT + /* This must appear in all extensions that define a my_cxt_t structure, * right after the definition (i.e. at file scope). The non-threads * case below uses it to declare the data as static. */ @@ -4345,13 +4345,6 @@ DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv) Zero(my_cxtp, 1, my_cxt_t); \ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) -/* Clones the per-interpreter data. */ -#define MY_CXT_CLONE \ - dMY_CXT_SV; \ - my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ - Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\ - sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) - /* This macro must be used to access members of the my_cxt_t structure. * e.g. MYCXT.some_data */ #define MY_CXT (*my_cxtp) @@ -4365,13 +4358,25 @@ DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv) #define aMY_CXT_ aMY_CXT, #define _aMY_CXT ,aMY_CXT +#endif /* START_MY_CXT */ + +#ifndef MY_CXT_CLONE +/* Clones the per-interpreter data. */ +#define MY_CXT_CLONE \ + dMY_CXT_SV; \ + my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ + Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\ + sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) +#endif + #else /* single interpreter */ +#ifndef START_MY_CXT + #define START_MY_CXT static my_cxt_t my_cxt; #define dMY_CXT_SV dNOOP #define dMY_CXT dNOOP #define MY_CXT_INIT NOOP -#define MY_CXT_CLONE NOOP #define MY_CXT my_cxt #define pMY_CXT void @@ -4381,10 +4386,14 @@ DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv) #define aMY_CXT_ #define _aMY_CXT -#endif - #endif /* START_MY_CXT */ +#ifndef MY_CXT_CLONE +#define MY_CXT_CLONE NOOP +#endif + +#endif + #ifndef IVdf # if IVSIZE == LONGSIZE # define IVdf "ld" diff --git a/ext/Devel/PPPort/PPPort.xs b/ext/Devel/PPPort/PPPort.xs index 4cee9d0..2056271 100644 --- a/ext/Devel/PPPort/PPPort.xs +++ b/ext/Devel/PPPort/PPPort.xs @@ -721,6 +721,14 @@ MY_CXT_2() OUTPUT: RETVAL +int +MY_CXT_CLONE() + CODE: + MY_CXT_CLONE; + RETVAL = 42; + OUTPUT: + RETVAL + ##---------------------------------------------------------------------- ## XSUBs from parts/inc/newCONSTSUB ##---------------------------------------------------------------------- diff --git a/ext/Devel/PPPort/PPPort_pm.PL b/ext/Devel/PPPort/PPPort_pm.PL index ce93577..06b143d 100644 --- a/ext/Devel/PPPort/PPPort_pm.PL +++ b/ext/Devel/PPPort/PPPort_pm.PL @@ -473,7 +473,7 @@ require DynaLoader; use strict; use vars qw($VERSION @ISA $data); -$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.02 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; +$VERSION = do { my @r = '$Snapshot: /Devel-PPPort/3.03 $' =~ /(\d+\.\d+(?:_\d+)?)/; @r ? $r[0] : '9.99' }; @ISA = qw(DynaLoader); diff --git a/ext/Devel/PPPort/parts/inc/MY_CXT b/ext/Devel/PPPort/parts/inc/MY_CXT index 12858fd..5ef575f 100644 --- a/ext/Devel/PPPort/parts/inc/MY_CXT +++ b/ext/Devel/PPPort/parts/inc/MY_CXT @@ -1,8 +1,8 @@ ################################################################################ ## -## $Revision: 8 $ +## $Revision: 9 $ ## $Author: mhx $ -## $Date: 2004/09/08 21:12:15 +0200 $ +## $Date: 2004/09/08 22:15:16 +0200 $ ## ################################################################################ ## @@ -32,8 +32,6 @@ _aMY_CXT =implementation -#ifndef START_MY_CXT - /* * Boilerplate macros for initializing and accessing interpreter-local * data from C. All statics in extensions should be reworked to use @@ -56,6 +54,8 @@ _aMY_CXT #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \ defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT) +#ifndef START_MY_CXT + /* This must appear in all extensions that define a my_cxt_t structure, * right after the definition (i.e. at file scope). The non-threads * case below uses it to declare the data as static. */ @@ -87,13 +87,6 @@ _aMY_CXT Zero(my_cxtp, 1, my_cxt_t); \ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) -/* Clones the per-interpreter data. */ -#define MY_CXT_CLONE \ - dMY_CXT_SV; \ - my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ - Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\ - sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) - /* This macro must be used to access members of the my_cxt_t structure. * e.g. MYCXT.some_data */ #define MY_CXT (*my_cxtp) @@ -107,13 +100,25 @@ _aMY_CXT #define aMY_CXT_ aMY_CXT, #define _aMY_CXT ,aMY_CXT +#endif /* START_MY_CXT */ + +#ifndef MY_CXT_CLONE +/* Clones the per-interpreter data. */ +#define MY_CXT_CLONE \ + dMY_CXT_SV; \ + my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ + Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\ + sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) +#endif + #else /* single interpreter */ +#ifndef START_MY_CXT + #define START_MY_CXT static my_cxt_t my_cxt; #define dMY_CXT_SV dNOOP #define dMY_CXT dNOOP #define MY_CXT_INIT NOOP -#define MY_CXT_CLONE NOOP #define MY_CXT my_cxt #define pMY_CXT void @@ -123,10 +128,14 @@ _aMY_CXT #define aMY_CXT_ #define _aMY_CXT -#endif - #endif /* START_MY_CXT */ +#ifndef MY_CXT_CLONE +#define MY_CXT_CLONE NOOP +#endif + +#endif + =xsmisc #define MY_CXT_KEY "Devel::PPPort::_guts" XS_VERSION @@ -167,8 +176,17 @@ MY_CXT_2() OUTPUT: RETVAL -=tests plan => 2 +int +MY_CXT_CLONE() + CODE: + MY_CXT_CLONE; + RETVAL = 42; + OUTPUT: + RETVAL + +=tests plan => 3 ok(&Devel::PPPort::MY_CXT_1()); ok(&Devel::PPPort::MY_CXT_2()); +ok(&Devel::PPPort::MY_CXT_CLONE()); diff --git a/ext/Devel/PPPort/t/MY_CXT.t b/ext/Devel/PPPort/t/MY_CXT.t index f2c4e2d..e9f1238 100644 --- a/ext/Devel/PPPort/t/MY_CXT.t +++ b/ext/Devel/PPPort/t/MY_CXT.t @@ -24,10 +24,10 @@ BEGIN { eval "use Test"; if ($@) { require 'testutil.pl'; - print "1..2\n"; + print "1..3\n"; } else { - plan(tests => 2); + plan(tests => 3); } } @@ -37,4 +37,5 @@ $^W = 1; ok(&Devel::PPPort::MY_CXT_1()); ok(&Devel::PPPort::MY_CXT_2()); +ok(&Devel::PPPort::MY_CXT_CLONE());