summaryrefslogtreecommitdiff
path: root/srcpos.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-09-27 17:11:05 -0600
committerJon Loeliger <jdl@jdl.com>2012-09-28 09:24:39 -0500
commit1b6d1941dc5b589632c254ee6e960404d7cef5f2 (patch)
treee9104f21e58cc57ca56879e84935f2db78e19e1e /srcpos.c
parent1ff3d3f8de701ed107e908030b5c1fed9d17125a (diff)
downloaddevice-tree-compiler-1b6d1941dc5b589632c254ee6e960404d7cef5f2.tar.gz
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 <swarren@nvidia.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'srcpos.c')
-rw-r--r--srcpos.c6
1 files changed, 6 insertions, 0 deletions
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;
+}