In the C code that Porting/expand-macro.pl generates, it #includes the
header containing the macro, to ensure that the macro definition is seen.
This was skipped for perl.h and EXTERN.h, which it always automatically
includes. However, perl.h includes embed.h and embedvar.h and then undefines
and redefines macros in them. Hence if either header is included (again) the
compiler warns about macro redefinitions. Hence ensure that neither is
included a second time.
my $sentinel = "$macro expands to";
-my %done_header;
+# These two are included from perl.h, and perl.h sometimes redefines their
+# macros. So no need to include them.
+my %done_header = ('embed.h' => 1, 'embedvar.h' => 1);
sub do_header {
my $header = shift;