summaryrefslogtreecommitdiff
path: root/embed.pl
diff options
context:
space:
mode:
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;
}