summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mg_vtable.h4
-rw-r--r--perl.h4
-rw-r--r--regen/mg_vtable.pl8
3 files changed, 7 insertions, 9 deletions
diff --git a/mg_vtable.h b/mg_vtable.h
index ebe448a454..43530883a0 100644
--- a/mg_vtable.h
+++ b/mg_vtable.h
@@ -134,9 +134,9 @@ MGVTBL_SET(
0
);
-MGVTBL_SET_CONST_MAGIC_GET(
+MGVTBL_SET(
PL_vtbl_arylen,
- Perl_magic_getarylen,
+ (int (*)(pTHX_ SV *, MAGIC *))Perl_magic_getarylen,
Perl_magic_setarylen,
0,
0,
diff --git a/perl.h b/perl.h
index 71ef2f57c0..c4e3d6df61 100644
--- a/perl.h
+++ b/perl.h
@@ -5110,12 +5110,8 @@ START_EXTERN_C
#ifdef DOINIT
# define MGVTBL_SET(var,a,b,c,d,e,f,g,h) EXT_MGVTBL var = {a,b,c,d,e,f,g,h}
-/* Like MGVTBL_SET but with the get magic having a const MG* */
-# define MGVTBL_SET_CONST_MAGIC_GET(var,a,b,c,d,e,f,g,h) EXT_MGVTBL var \
- = {(int (*)(pTHX_ SV *, MAGIC *))a,b,c,d,e,f,g,h}
#else
# define MGVTBL_SET(var,a,b,c,d,e,f,g,h) EXT_MGVTBL var
-# define MGVTBL_SET_CONST_MAGIC_GET(var,a,b,c,d,e,f,g,h) EXT_MGVTBL var
#endif
#include "mg_vtable.h"
diff --git a/regen/mg_vtable.pl b/regen/mg_vtable.pl
index d3557ec43b..6322b8b018 100644
--- a/regen/mg_vtable.pl
+++ b/regen/mg_vtable.pl
@@ -18,6 +18,7 @@ BEGIN {
require 'regen/regen_lib.pl';
}
+# These have a subtly different "namespace" from the magic types.
my @sig =
(
'sv' => {get => 'get', set => 'set', len => 'len'},
@@ -82,15 +83,16 @@ print $h <<'EOH';
EOH
while (my ($name, $data) = splice @sig, 0, 2) {
- my $funcs = join ",\n ", map {
+ my @funcs = map {
$data->{$_} ? "Perl_magic_$data->{$_}" : 0;
} qw(get set len clear free copy dup local);
- my $set_macro = $data->{const} ? 'MGVTBL_SET_CONST_MAGIC_GET' : 'MGVTBL_SET';
+ $funcs[0] = "(int (*)(pTHX_ SV *, MAGIC *))" . $funcs[0] if $data->{const};
+ my $funcs = join ",\n ", @funcs;
print $h "$data->{cond}\n" if $data->{cond};
print $h <<"EOT";
-$set_macro(
+MGVTBL_SET(
PL_vtbl_$name,
$funcs
);