[Mesa-dev] [PATCH 6/8] glcpp: Add --disable-line-continuations argument to standalone glcpp

Matt Turner mattst88 at gmail.com
Wed Jan 2 19:37:42 PST 2013


On Wed, Dec 5, 2012 at 5:32 PM, Carl Worth <cworth at cworth.org> wrote:
> This will allow testing of disabled line-continuation on a case-by-case basis,
> (with the option communicated to the preprocessor via the GL context).
> ---
>  src/glsl/glcpp/glcpp.c |   43 +++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 41 insertions(+), 2 deletions(-)
>
> diff --git a/src/glsl/glcpp/glcpp.c b/src/glsl/glcpp/glcpp.c
> index 79fbdac..5352703 100644
> --- a/src/glsl/glcpp/glcpp.c
> +++ b/src/glsl/glcpp/glcpp.c
> @@ -100,6 +100,18 @@ static void
>  init_fake_gl_context (struct gl_context *gl_ctx)
>  {
>         gl_ctx->API = API_OPENGL_COMPAT;
> +       gl_ctx->Const.DisableGLSLLineContinuations = false;
> +}
> +
> +static void
> +usage (void)
> +{
> +       fprintf (stderr, "Usage: glcpp [OPTIONS] [--] [<filename>]\n");
> +       fprintf (stderr, "\n");
> +       fprintf (stderr, "Pre-process the given filename (stdin if no filename given).\n");
> +       fprintf (stderr, "The following options are supported:\n");
> +       fprintf (stderr, "    --disable-line-continuations      Do not interpret lines ending with a\n");
> +       fprintf (stderr, "                                      backslash ('\\') as a line continuation.\n");

I'd probably just make these six function calls a single one.


More information about the mesa-dev mailing list