From 75f82519ae1a4af2d3c7f0cf2509770566cbeeff Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 8 Dec 2005 14:07:37 +0000 Subject: Updated doc to explain usage of #if macros and gentree updated - Updated to explain usage of #if macros - gentree was removing linux/version.h from .c files. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/gentree.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'v4l/scripts/gentree.pl') diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl index 7c044ee06..74db9f1ad 100644 --- a/v4l/scripts/gentree.pl +++ b/v4l/scripts/gentree.pl @@ -67,10 +67,6 @@ sub filter_source ($$) { print STDERR "File: $in, for kernel $VERSION($CODE)/\n" if $DEBUG; while ($line = ) { - if ($line =~ m/^#include / && - $in =~ m/.*\.c/) { - next; - } if ($line =~ m/^#include \"compat.h\"/) { next; } @@ -93,6 +89,14 @@ sub filter_source ($$) { $level++; next; } + if ($line =~ /^#if 0\s.*[Kk][Ee][Ee][Pp].*/) { + chomp($line); + $state{$level} = "ifother"; + $if{$level} = 0; + print STDERR "/* BP #if 0 (keep) state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; + $level++; + next; + } if ($line =~ /^#if 1\s.*[Kk][Ee][Ee][Pp].*/) { print OUT "#if 1\n"; $state{$level} = "ifother"; -- cgit v1.2.3