[PATCH 5.004_60] Fix to MM_VMS.PM
[p5sagit/p5-mst-13.2.git] / bytecode.pl
index d753213..e72d852 100644 (file)
@@ -20,7 +20,7 @@ while (($from, $tos) = each %alias_to) {
 
 my $c_header = <<'EOT';
 /*
- *      Copyright (c) 1996, 1997 Malcolm Beattie
+ *      Copyright (c) 1996-1998 Malcolm Beattie
  *
  *      You may distribute under the terms of either the GNU General Public
  *      License or the Artistic License, as specified in the README file.
@@ -34,20 +34,12 @@ EOT
 my $perl_header;
 ($perl_header = $c_header) =~ s{[/ ]?\*/?}{#}g;
 
-if (-f "byterun.c") {
-    rename("byterun.c", "byterun.c.old");
-}
-if (-f "byterun.h") {
-    rename("byterun.h", "byterun.h.old");
-}
-if (-f "B/Asmdata.pm") {
-    rename("B/Asmdata.pm", "B/Asmdata.pm.old");
-}
+unlink "byterun.c", "byterun.h", "ext/B/B/Asmdata.pm";
 
 #
 # Start with boilerplate for Asmdata.pm
 #
-open(ASMDATA_PM, ">B/Asmdata.pm") or die "Asmdata.pm: $!";
+open(ASMDATA_PM, ">ext/B/B/Asmdata.pm") or die "ext/B/B/Asmdata.pm: $!";
 print ASMDATA_PM $perl_header, <<'EOT';
 package B::Asmdata;
 use Exporter;
@@ -77,11 +69,9 @@ print BYTERUN_C $c_header, <<'EOT';
 #include "byterun.h"
 
 #ifdef INDIRECT_BGET_MACROS
-void byterun(bs)
-struct bytestream bs;
+void byterun(struct bytestream bs)
 #else
-void byterun(fp)
-FILE *fp;
+void byterun(FILE *fp)
 #endif /* INDIRECT_BGET_MACROS */
 {
     dTHR;
@@ -220,13 +210,14 @@ print BYTERUN_H <<'EOT';
 EOT
 
 printf BYTERUN_H <<'EOT', scalar(@specialsv);
-EXT SV * specialsv_list[%d]
-#ifdef DOINIT
+EXT SV * specialsv_list[%d];
+#define INIT_SPECIALSV_LIST STMT_START { \
 EOT
-print BYTERUN_H "= { ", join(", ", @specialsv), " }\n";
+for ($i = 0; $i < @specialsv; $i++) {
+    print BYTERUN_H "\tspecialsv_list[$i] = $specialsv[$i]; \\\n";
+}
 print BYTERUN_H <<'EOT';
-#endif /* DOINIT */
-;
+    } STMT_END
 EOT
 
 #