diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-09-27 17:11:05 -0600 |
---|---|---|
committer | Jon Loeliger <jdl@jdl.com> | 2012-09-28 09:24:39 -0500 |
commit | 1b6d1941dc5b589632c254ee6e960404d7cef5f2 (patch) | |
tree | e9104f21e58cc57ca56879e84935f2db78e19e1e /srcpos.c | |
parent | 1ff3d3f8de701ed107e908030b5c1fed9d17125a (diff) | |
download | dtc-1b6d1941dc5b589632c254ee6e960404d7cef5f2.zip dtc-1b6d1941dc5b589632c254ee6e960404d7cef5f2.tar.gz dtc-1b6d1941dc5b589632c254ee6e960404d7cef5f2.tar.bz2 |
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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; +} |