From 1b6d1941dc5b589632c254ee6e960404d7cef5f2 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 27 Sep 2012 17:11:05 -0600 Subject: dtc: cpp co-existence: add support for #line directives Line control directives of the following formats are supported: #line LINE "FILE" # LINE "FILE" [FLAGS] This allows dtc to consume the output of pre-processors, and to provide error messages that refer to the original filename, including taking into account any #include directives that the pre-processor may have performed. Signed-off-by: Stephen Warren Acked-by: David Gibson --- srcpos.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'srcpos.c') diff --git a/srcpos.c b/srcpos.c index 3ee523d..246ab4b 100644 --- a/srcpos.c +++ b/srcpos.c @@ -328,3 +328,9 @@ srcpos_warn(struct srcpos *pos, char const *fmt, ...) va_end(va); } + +void srcpos_set_line(char *f, int l) +{ + current_srcfile->name = f; + current_srcfile->lineno = l; +} -- cgit v1.2.1