-$Id: Changes,v 1.1 2004/08/18 17:53:45 xmath Exp $
+0.04 -- Fri Jul 18 15:23 CEST 2008
+ * Fixed for perl 5.6 and 5.005 threads (tested)
0.03 -- Wed Feb 20 20:19 CET 2008
* Fixed crash when trying to rename xsubs
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Sub-Name
-version: 0.03
-version_from: lib/Sub/Name.pm
-installdirs: site
-requires:
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+--- #YAML:1.0
+name: Sub-Name
+version: 0.04
+abstract: (re)name a sub
+license: ~
+author:
+ - Matthijs van Duin <xmath@cpan.org>
+generated_by: ExtUtils::MakeMaker version 6.42
+distribution_type: module
+requires:
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
-# $Id: Makefile.PL,v 1.1 2004/08/17 19:23:24 xmath Exp $
-
use 5.006;
use ExtUtils::MakeMaker;
-/* $Id: Name.xs,v 1.5 2004/08/18 13:21:44 xmath Exp $
- * Copyright (C) 2004 Matthijs van Duin. All rights reserved.
+/* Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved.
* This program is free software; you can redistribute it and/or modify
* it under the same terms as Perl itself.
*/
static MGVTBL subname_vtbl;
+#ifndef PERL_MAGIC_ext
+# define PERL_MAGIC_ext '~'
+#endif
+
+#ifndef SvMAGIC_set
+#define SvMAGIC_set(sv, val) (SvMAGIC(sv) = (val))
+#endif
+
+
MODULE = Sub::Name PACKAGE = Sub::Name
PROTOTYPES: DISABLE
if (CvPADLIST(cv)) {
/* cheap way to refcount the gv */
av_store((AV *) AvARRAY(CvPADLIST(cv))[0], 0, (SV *) gv);
- }
+ } else
#endif
- else {
+ {
/* expensive way to refcount the gv */
MAGIC *mg = SvMAGIC(cv);
while (mg && mg->mg_virtual != &subname_vtbl)
mg = mg->mg_moremagic;
- if (!mg)
- mg = sv_magicext((SV *) cv, NULL, PERL_MAGIC_ext,
- &subname_vtbl, NULL, 0);
+ if (!mg) {
+ Newz(702, mg, 1, MAGIC);
+ mg->mg_moremagic = SvMAGIC(cv);
+ mg->mg_type = PERL_MAGIC_ext;
+ mg->mg_virtual = &subname_vtbl;
+ SvMAGIC_set(cv, mg);
+ }
if (mg->mg_flags & MGf_REFCOUNTED)
SvREFCNT_dec(mg->mg_obj);
mg->mg_flags |= MGf_REFCOUNTED;
-$Id: README,v 1.5 2004/08/18 17:53:45 xmath Exp $
-
-Sub::Name 0.01
+Sub::Name 0.04
To install this module type the following:
AUTHOR
Matthijs van Duin <xmath@cpan.org>
- Copyright (C) 2004 Matthijs van Duin. All rights reserved. This program
- is free software; you can redistribute it and/or modify it under the
- same terms as Perl itself.
+ Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved. This
+ program is free software; you can redistribute it and/or modify it under
+ the same terms as Perl itself.
-# $Id: Name.pm,v 1.5 2004/08/18 17:53:45 xmath Exp $
-
package Sub::Name;
=head1 NAME
Matthijs van Duin <xmath@cpan.org>
-Copyright (C) 2004 Matthijs van Duin. All rights reserved.
+Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
use strict;
use warnings;
-our $VERSION = '0.03';
+our $VERSION = '0.04';
use base 'Exporter';
use base 'DynaLoader';
print $x->() eq "Blork::Dynamic $_" ? "ok $_\n" : "not ok $_\n";
}
-# $Id: smoke.t,v 1.4 2004/08/18 12:03:42 xmath Exp $
# vim: ft=perl