Change 34044 by [EMAIL PROTECTED] on 2008/06/11 22:07:33
Patch from MHX to change the WriteConstant()'s documentation to note
that to change the constant subroutine's name one needs XS_SUBNAME
not SUBNAME, and then make C_SUBNAME default to XS_SUBNAME to be
consistent with the revised documentation.
http://rt.cpan.org/Public/Bug/Display.html?id=29968
Affected files ...
... //depot/perl/lib/ExtUtils/Constant.pm#30 edit
Differences ...
==== //depot/perl/lib/ExtUtils/Constant.pm#30 (text) ====
Index: perl/lib/ExtUtils/Constant.pm
--- perl/lib/ExtUtils/Constant.pm#29~34043~ 2008-06-11 13:39:19.000000000
-0700
+++ perl/lib/ExtUtils/Constant.pm 2008-06-11 15:07:33.000000000 -0700
@@ -149,7 +149,7 @@
breakout => $breakout}, @items);
}
-=item XS_constant PACKAGE, TYPES, SUBNAME, C_SUBNAME
+=item XS_constant PACKAGE, TYPES, XS_SUBNAME, C_SUBNAME
A function to generate the XS code to implement the perl subroutine
I<PACKAGE>::constant used by I<PACKAGE>::AUTOLOAD to load constants.
@@ -163,7 +163,7 @@
the number of parameters passed to the C function C<constant>]
You can call the perl visible subroutine something other than C<constant> if
-you give the parameter I<SUBNAME>. The C subroutine it calls defaults to
+you give the parameter I<XS_SUBNAME>. The C subroutine it calls defaults to
the name of the perl visible subroutine, unless you give the parameter
I<C_SUBNAME>.
@@ -172,10 +172,10 @@
sub XS_constant {
my $package = shift;
my $what = shift;
- my $subname = shift;
+ my $XS_subname = shift;
my $C_subname = shift;
- $subname ||= 'constant';
- $C_subname ||= $subname;
+ $XS_subname ||= 'constant';
+ $C_subname ||= $XS_subname;
if (!ref $what) {
# Convert line of the form IV,UV,NV to hash
@@ -186,7 +186,7 @@
my $xs = <<"EOT";
void
-$subname(sv)
+$XS_subname(sv)
PREINIT:
#ifdef dXSTARG
dXSTARG; /* Faster if we have it. */
@@ -465,7 +465,7 @@
The name of the file to write containing the XS code. The default is
C<const-xs.inc>.
-=item SUBNAME
+=item XS_SUBNAME
The perl visible name of the XS subroutine generated which will return the
constants. The default is C<constant>.
@@ -473,7 +473,7 @@
=item C_SUBNAME
The name of the C subroutine generated which will return the constants.
-The default is I<SUBNAME>. Child subroutines have C<_> and the name
+The default is I<XS_SUBNAME>. Child subroutines have C<_> and the name
length appended, so constants with 10 character names would be in
C<constant_10> with the default I<XS_SUBNAME>.
@@ -486,11 +486,11 @@
( # defaults
C_FILE => 'const-c.inc',
XS_FILE => 'const-xs.inc',
- SUBNAME => 'constant',
+ XS_SUBNAME => 'constant',
DEFAULT_TYPE => 'IV',
@_);
- $ARGS{C_SUBNAME} ||= $ARGS{SUBNAME}; # No-one sane will have C_SUBNAME eq '0'
+ $ARGS{C_SUBNAME} ||= $ARGS{XS_SUBNAME}; # No-one sane will have C_SUBNAME eq
'0'
croak "Module name not specified" unless length $ARGS{NAME};
End of Patch.