summaryrefslogtreecommitdiff
path: root/embed.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-09-30 11:31:40 +0100
committerNicholas Clark <nick@ccl4.org>2010-09-30 11:32:17 +0100
commitb2e549c0b5ccc745d727de4e27634e8090b0f719 (patch)
treedf827f68e9973c739c6d35a41bde3b8e1a17330f /embed.pl
parent2a4d8072390905d051b0d9f7d2098b1c97899cdc (diff)
downloadperl-b2e549c0b5ccc745d727de4e27634e8090b0f719.tar.gz
Merge adjacent #ifndef PERL_IMPLICIT_CONTEXT blocks in embed.h
Diffstat (limited to 'embed.pl')
-rwxr-xr-xembed.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/embed.pl b/embed.pl
index f5ed05bb96..75b06ed38b 100755
--- a/embed.pl
+++ b/embed.pl
@@ -532,6 +532,14 @@ sub embed_h {
# Prune empty #if/#endif pairs.
while ($lines =~ s/#\s*if[^\n]+\n#\s*endif\n//) {
}
+ # Merge adjacent blocks.
+ while ($lines =~ s/(#ifndef PERL_IMPLICIT_CONTEXT
+[^\n]+
+)#endif
+#ifndef PERL_IMPLICIT_CONTEXT
+/$1/) {
+ }
+
print $em $lines;
print $em "#endif\n" if $guard;
}