diff options
author | Michal Krol <[email protected]> | 2009-09-04 15:27:08 +0200 |
---|---|---|
committer | Michal Krol <[email protected]> | 2009-09-07 10:12:10 +0200 |
commit | a64ba93aab6de7ee2ceb70f39cf2dbe794940c97 (patch) | |
tree | d576bc47c543fa6506cb49d506283b4e3e51ecf5 /src/glsl/pp/sl_pp_line.c | |
parent | 2d2d6384448baae3c04eced3373d96907def4e13 (diff) |
glsl: Handle file numbering.
Diffstat (limited to 'src/glsl/pp/sl_pp_line.c')
-rw-r--r-- | src/glsl/pp/sl_pp_line.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index 9b9f45dcedd..a56417a8610 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -134,7 +134,26 @@ sl_pp_process_line(struct sl_pp_context *context, context->line = line; } - /* TODO: Do something with the file number. */ + if (file_number != -1) { + unsigned int file; + + str = sl_pp_context_cstr(context, file_number); + if (_parse_integer(str, &file)) { + return -1; + } + + if (context->file != file) { + struct sl_pp_token_info ti; + + ti.token = SL_PP_FILE; + ti.data.file = file; + if (sl_pp_process_out(pstate, &ti)) { + return -1; + } + + context->file = file; + } + } return 0; } |