From d2d976033cfa7edcad5823c19aa8ff1646eb21dd Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 8 Dec 2005 20:43:49 +0000 Subject: fixes handling for #if 0/#if 1 with keep Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/gentree.pl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl index 74db9f1ad..891459749 100644 --- a/v4l/scripts/gentree.pl +++ b/v4l/scripts/gentree.pl @@ -81,19 +81,20 @@ sub filter_source ($$) { $level++; next; } - if ($line =~ /^#if 0/) { + if ($line =~ /^\s*#if 0\s.*[Kk][Ee][Ee][Pp].*/) { + print OUT "#if 0\n"; chomp($line); - $state{$level} = "if"; + $state{$level} = "ifother"; $if{$level} = 0; - print STDERR "/* BP #if 0 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; + print STDERR "/* BP #if 0 (keep) state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; $level++; next; } - if ($line =~ /^#if 0\s.*[Kk][Ee][Ee][Pp].*/) { + if ($line =~ /^#if 0/) { chomp($line); - $state{$level} = "ifother"; + $state{$level} = "if"; $if{$level} = 0; - print STDERR "/* BP #if 0 (keep) state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; + print STDERR "/* BP #if 0 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; $level++; next; } -- cgit v1.2.3