mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-27 09:22:14 +00:00
vkd3d-shader: Implement __LINE__.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d33a896403
commit
e72c2461cd
@ -471,6 +471,26 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!strcmp(text, "__LINE__"))
|
||||
{
|
||||
const struct preproc_file *file = preproc_get_top_file(ctx);
|
||||
|
||||
/* Not the current line number, but rather the line
|
||||
* number before invoking any macros. */
|
||||
|
||||
if (ctx->current_directive)
|
||||
{
|
||||
char string[13];
|
||||
|
||||
sprintf(string, "%d", file->buffer.location.line);
|
||||
return return_token(T_INTEGER, lval, string);
|
||||
}
|
||||
|
||||
if (preproc_is_writing(ctx))
|
||||
vkd3d_string_buffer_printf(&ctx->buffer, "%d ", file->buffer.location.line);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->current_directive)
|
||||
|
@ -350,7 +350,7 @@ static void test_preprocess(void)
|
||||
for (i = 0; i < ARRAY_SIZE(tests); ++i)
|
||||
{
|
||||
vkd3d_test_set_context("Source \"%s\"", tests[i].source);
|
||||
todo_if (i == 9 || (i >= 12 && i <= 14))
|
||||
todo_if (i == 9)
|
||||
check_preprocess(tests[i].source, NULL, NULL, tests[i].present, tests[i].absent);
|
||||
}
|
||||
vkd3d_test_set_context(NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user