[Piglit] [PATCH 6/9] util/gl: remove '#if defined(GL_SYMBOL)' guards

Ilia Mirkin imirkin at alum.mit.edu
Mon Jun 27 17:04:46 UTC 2016


Don't we build against local GL headers? So we pretty much control
what's available and what's not. i.e. do we need those ifdefs?

On Mon, Jun 27, 2016 at 12:52 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Those symbols are part of the ABI/API and cannot change. Just define
> them locally when needed.
>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  tests/util/piglit-util-gl.c | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
> index 727a901..b6bf4de 100644
> --- a/tests/util/piglit-util-gl.c
> +++ b/tests/util/piglit-util-gl.c
> @@ -156,6 +156,17 @@ void piglit_require_not_extension(const char *name)
>
>  const char* piglit_get_gl_error_name(GLenum error)
>  {
> +/* enums that are not available everywhere */
> +#ifndef GL_STACK_OVERFLOW
> +#define GL_STACK_OVERFLOW                 0x0503
> +#endif
> +#ifndef GL_STACK_UNDERFLOW
> +#define GL_STACK_UNDERFLOW                0x0504
> +#endif
> +#ifndef GL_INVALID_FRAMEBUFFER_OPERATION
> +#define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
> +#endif
> +
>  #define CASE(x) case x: return #x;
>      switch (error) {
>      CASE(GL_INVALID_ENUM)
> @@ -163,16 +174,9 @@ const char* piglit_get_gl_error_name(GLenum error)
>      CASE(GL_INVALID_VALUE)
>      CASE(GL_NO_ERROR)
>      CASE(GL_OUT_OF_MEMORY)
> -    /* enums that are not available everywhere */
> -#if defined(GL_STACK_OVERFLOW)
>      CASE(GL_STACK_OVERFLOW)
> -#endif
> -#if defined(GL_STACK_UNDERFLOW)
>      CASE(GL_STACK_UNDERFLOW)
> -#endif
> -#if defined(GL_INVALID_FRAMEBUFFER_OPERATION)
>      CASE(GL_INVALID_FRAMEBUFFER_OPERATION)
> -#endif
>      default:
>          return "(unrecognized error)";
>      }
> --
> 2.8.2
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list