Change 24886 was buggy - should be taking (and passing in) the
[p5sagit/p5-mst-13.2.git] / vms / gen_shrfls.pl
index a0ade7e..50ae3e3 100644 (file)
@@ -39,7 +39,7 @@ require 5.000;
 
 $debug = $ENV{'GEN_SHRFLS_DEBUG'};
 
-print "gen_shrfls.pl Rev. 18-May-2001\n" if $debug;
+print "gen_shrfls.pl Rev. 18-Dec-2003\n" if $debug;
 
 if ($ARGV[0] eq '-f') {
   open(INP,$ARGV[1]) or die "Can't read input file $ARGV[1]: $!\n";
@@ -56,7 +56,8 @@ if ($ARGV[0] eq '-f') {
 $cc_cmd = shift @ARGV;
 
 # Someday, we'll have $GetSyI built into perl . . .
-$isvax = `\$ Write Sys\$Output F\$GetSyI(\"HW_MODEL\")` <= 1024;
+$isvax = `\$ Write Sys\$Output \(F\$GetSyI(\"HW_MODEL\") .LE. 1024 .AND. F\$GetSyI(\"HW_MODEL\") .GT. 0\)`;
+chomp $isvax;
 print "\$isvax: \\$isvax\\\n" if $debug;
 
 print "Input \$cc_cmd: \\$cc_cmd\\\n" if $debug;
@@ -76,7 +77,7 @@ if ($docc) {
   open CONFIG, "< $config";
   while(<CONFIG>) {
     $use_threads++ if /usethreads='(define|yes|true|t|y|1)'/i;
-    $use_mymalloc++ if /usemymalloc='(define|yes|true|t|y1)'/i;
+    $use_mymalloc++ if /usemymalloc='(define|yes|true|t|y|1)'/i;
     $care_about_case++ if /d_vms_case_sensitive_symbols='(define|yes|true|t|y|1)'/i;
     $debugging_enabled++ if /usedebugging_perl='(define|yes|true|t|y|1)'/i;
     $hide_mymalloc++ if /embedmymalloc='(define|yes|true|t|y|1)'/i;
@@ -151,7 +152,7 @@ sub scan_func {
   $line =~ s/\b(IV|Off_t|Size_t|SSize_t|void)\b//i;
   if ( $line =~ /(\w+)\s*\(/ ) {
     print "\troutine name is \\$1\\\n" if $debug > 1;
-    if ($1 eq 'main' || $1 eq 'perl_init_ext') {
+    if ($1 eq 'main' || $1 eq 'perl_init_ext' || $1 eq '__attribute__format__') {
       print "\tskipped\n" if $debug > 1;
     }
     else { $fcns{$1}++ }
@@ -167,9 +168,9 @@ if ($use_mymalloc) {
 }
 
 if ($use_perlio) {
-  $preprocess_list = "${dir}perl.h,${dir}perliol.h";
+  $preprocess_list = "${dir}perl.h+${dir}perlapi.h,${dir}perliol.h";
 } else {
-  $preprocess_list = "${dir}perl.h";
+  $preprocess_list = "${dir}perl.h+${dir}perlapi.h";
 }
 
 $used_expectation_enum = $used_opcode_enum = 0; # avoid warnings
@@ -180,7 +181,7 @@ if ($docc) {
 else {
   open(CPP,"$cpp_file") or die "$0: Can't read preprocessed file $cpp_file: $!\n";
 }
-%checkh = map { $_,1 } qw( thread bytecode byterun proto perlio );
+%checkh = map { $_,1 } qw( thread bytecode byterun proto perlio perlvars intrpvar thrdvar );
 $ckfunc = 0;
 LINE: while (<CPP>) {
   while (/^#.*vmsish\.h/i .. /^#.*perl\.h/i) {
@@ -213,7 +214,7 @@ LINE: while (<CPP>) {
   }
   if ($ckfunc) {
     print "$scanname>> $_" if $debug > 2;
-    if (/\s*^EXT/) { &scan_var($_);  }
+    if (/^\s*EXT/) { &scan_var($_);  }
     else           { &scan_func($_); }
   }
   else {