From d313dab5eea860bc36d9c4e259073850708080e1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 16 Dec 2003 00:38:33 +0000 Subject: cope with different cpp formatting on some systems, and make sure we don't loop forever if we get a cpp format line we don't understand (This used to be commit 003c6c493b1babadb1f7c4eb54babed394bd42a9) --- source4/build/pidl/idl.pm | 9 ++++++++- source4/build/pidl/idl.yp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/build/pidl/idl.pm b/source4/build/pidl/idl.pm index d5c0ae0071..ee7fd8d9cf 100644 --- a/source4/build/pidl/idl.pm +++ b/source4/build/pidl/idl.pm @@ -1937,7 +1937,14 @@ again: $parser->YYData->{INPUT_FILENAME} = $2; goto again; } - goto again; + if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) { + $parser->YYData->{LINE} = $1-1; + $parser->YYData->{INPUT_FILENAME} = $2; + goto again; + } + if (s/^(\#.*)$//m) { + goto again; + } } if (s/^(\n)//) { $parser->YYData->{LINE}++; diff --git a/source4/build/pidl/idl.yp b/source4/build/pidl/idl.yp index bfc4698709..93446dc8c1 100644 --- a/source4/build/pidl/idl.yp +++ b/source4/build/pidl/idl.yp @@ -267,7 +267,14 @@ again: $parser->YYData->{INPUT_FILENAME} = $2; goto again; } - goto again; + if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) { + $parser->YYData->{LINE} = $1-1; + $parser->YYData->{INPUT_FILENAME} = $2; + goto again; + } + if (s/^(\#.*)$//m) { + goto again; + } } if (s/^(\n)//) { $parser->YYData->{LINE}++; -- cgit