summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-05-13 16:50:51 +0100
committerNicholas Clark <nick@ccl4.org>2011-06-11 10:12:18 +0200
commit0ffb5b03d3cde2b28eda4897b664c02ce9f0e9dd (patch)
treed5495e1bf5161e12ececfc72339df6203c583478 /regen
parent0a1f728a485818674e743b9fb9a3c149f9e53b6e (diff)
downloadperl-0ffb5b03d3cde2b28eda4897b664c02ce9f0e9dd.tar.gz
Move the work of MGVTBL_SET() from the C pre-processor to mg_vtable.pl
Generating mg_vtable.h with MGVTBL_SET() effectively pre-expanded makes things clearer. This eliminates use of the macro MGVTBL_SET(), which can be deleted as nothing outside the core is relying on it.
Diffstat (limited to 'regen')
-rw-r--r--regen/mg_vtable.pl15
1 files changed, 8 insertions, 7 deletions
diff --git a/regen/mg_vtable.pl b/regen/mg_vtable.pl
index 6322b8b018..bd48545191 100644
--- a/regen/mg_vtable.pl
+++ b/regen/mg_vtable.pl
@@ -68,8 +68,7 @@ print $h <<'EOH';
* (although most, but not all, compilers are prepared to do it)
*/
-/* args are:
- vtable
+/* order is:
get
set
len
@@ -88,14 +87,16 @@ while (my ($name, $data) = splice @sig, 0, 2) {
} qw(get set len clear free copy dup local);
$funcs[0] = "(int (*)(pTHX_ SV *, MAGIC *))" . $funcs[0] if $data->{const};
- my $funcs = join ",\n ", @funcs;
+ my $funcs = join ", ", @funcs;
print $h "$data->{cond}\n" if $data->{cond};
print $h <<"EOT";
-MGVTBL_SET(
- PL_vtbl_$name,
- $funcs
-);
+#ifdef DOINIT
+EXT_MGVTBL PL_vtbl_$name
+ = { $funcs };
+#else
+EXT_MGVTBL PL_vtbl_$name;
+#endif
EOT
print $h "#endif\n" if $data->{cond};
print $h "\n";