[PATCH vkd3d 3/5] vkd3d-shader: Implement function-like macro expansion.

Matteo Bruni matteo.mystral at gmail.com
Thu Jan 14 07:08:24 CST 2021


On Tue, Jan 12, 2021 at 11:15 PM Zebediah Figura
<zfigura at codeweavers.com> wrote:
>
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
>  Makefile.am                              |   1 -
>  libs/vkd3d-shader/preproc.h              |  35 +++
>  libs/vkd3d-shader/preproc.l              | 329 ++++++++++++++++++-----
>  libs/vkd3d-shader/preproc.y              |  46 +++-
>  libs/vkd3d-shader/vkd3d_shader_private.h |   2 +
>  tests/hlsl_d3d12.c                       |   2 +-
>  6 files changed, 338 insertions(+), 77 deletions(-)
>
> diff --git a/libs/vkd3d-shader/preproc.h b/libs/vkd3d-shader/preproc.h
> index 7d6bda2a..0f2d8ba9 100644
> --- a/libs/vkd3d-shader/preproc.h
> +++ b/libs/vkd3d-shader/preproc.h
> @@ -60,6 +60,9 @@ struct preproc_expansion
>  {
>      struct preproc_buffer buffer;
>      const struct preproc_text *text;
> +    /* Back-pointer to the macro, if this expansion a macro body. This is
> +     * necessary so that argument tokens can be correctly replaced. */
> +    struct preproc_macro *macro;
>  };

This comment seems to be missing a verb.

Something that I noticed and isn't specifically related to this patch:
it looks like sometimes there is a "spurious" whitespace at the start
of a line in the output, maybe after macro expansion. Just to mention
it, I don't know if you noticed already or if that's actually supposed
to happen in the first place.



More information about the wine-devel mailing list