Allow expand-macro.pl to expand macros in perl.h without pre-processor warnings.
authorNicholas Clark <nick@ccl4.org>
Thu, 18 Jun 2009 19:37:28 +0000 (20:37 +0100)
committerDavid Mitchell <davem@iabyn.com>
Tue, 23 Jun 2009 22:25:39 +0000 (23:25 +0100)
(cherry picked from commit 4784c5e80ccedd3734ce162e02ed1c7e25e60c01)

Porting/expand-macro.pl

index 34b76cb..ed8e188 100644 (file)
@@ -57,7 +57,12 @@ my $sentinel = "$macro expands to";
 print $out <<"EOF";
 #include "EXTERN.h"
 #include "perl.h"
-#include "$header"
+EOF
+
+print qq{#include "$header"\n}
+    unless $header eq 'perl.h' or $header eq 'EXTERN.h';
+
+print $out <<"EOF";
 #line 4 "$sentinel"
 $macro$args
 EOF