Change 34473 by [EMAIL PROTECTED] on 2008/10/11 16:13:12
Make sure expand-macro.pl also works for macros in headers
that are not included by perl.h (like regcomp.h).
Affected files ...
... //depot/perl/Porting/expand-macro.pl#5 edit
Differences ...
==== //depot/perl/Porting/expand-macro.pl#5 (text) ====
Index: perl/Porting/expand-macro.pl
--- perl/Porting/expand-macro.pl#4~33353~ 2008-02-22 12:06:15.000000000
-0800
+++ perl/Porting/expand-macro.pl 2008-10-11 09:13:12.000000000 -0700
@@ -44,7 +44,7 @@
my $args = '';
-my $found_macro;
+my $header;
while (<>) {
next unless /^#\s*define\s+$macro\b/;
my ($def_args) = /^#\s*define\s+$macro\(([^)]*)\)/;
@@ -54,17 +54,18 @@
my $argname = "A0";
$args = '(' . join (', ', map {$argname++} [EMAIL PROTECTED]) . ')';
}
- $found_macro++;
+ $header = $ARGV;
last;
}
-die "$macro not found\n" unless $found_macro;
+die "$macro not found\n" unless defined $header;
open my $out, '>', $trysource or die "Can't open $trysource: $!";
print $out <<"EOF";
#include "EXTERN.h"
#include "perl.h"
-#line 3 "$sentinel"
+#include "$header"
+#line 4 "$sentinel"
$macro$args
EOF
End of Patch.