sysdeftools/joinsysdef.pl
branchHighFidelityModel
changeset 413 9bcf6c827202
parent 276 d9662ec4599f
child 414 f503e8553dd5
--- a/sysdeftools/joinsysdef.pl	Fri Sep 10 14:37:00 2010 +0100
+++ b/sysdeftools/joinsysdef.pl	Mon Sep 13 17:07:54 2010 +0100
@@ -769,17 +769,18 @@
 sub getDefines
 	{ # populate the list of #defines from a specified .hrh file.
 	my $file = shift;
-	my $inc;
+	my $inc = '';
 	foreach my $i (@includes)
 		{
 		$inc.=" -I$i";
 		}
-	open(CPP,"cpp -dD$inc \"$file\"|");
+	open(CPP,"cpp -dD$inc \"$file\" 2>&1 |");
 	while(<CPP>)
 		{
+		s/\s+$//;
 		if(!/\S/){next} # skip blank lines
 		if(/^# [0-9]+ /) {next} # don't care about these
-		s/\s+$//;
+		if(/#undef/) { next } # don't care about these
 		if(s/^#define\s+(\S+)\((.*?)\)\s+//)
 			{ #parametered define
 			push(@{$defineParams{$1}},@2,$_);