[Mesa-dev] [PATCH 1/2] glx: Fix build errors with --enable-mangling (v2)

Emil Velikov emil.l.velikov at gmail.com
Thu Oct 1 01:32:12 PDT 2015


On 28 September 2015 at 18:59, Kyle Brenneman <kbrenneman at nvidia.com> wrote:
> Rearranged the GLX_ALIAS macro in glextensions.h so that it will pick up
> the renames from glx_mangle.h.
>
> Fixed the alias attribute for glXGetProcAddress when USE_MGL_NAMESPACE is
> defined.
>
> v2: Add a comment clarifying why GLX_ALIAS needs two macros.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55552
> Signed-off-by: Kyle Brenneman <kbrenneman at nvidia.com>
> Cc: "10.6 11.0" <mesa-stable at lists.freedesktop.org>
> ---
>  src/glx/glxcmds.c       |  4 ++++
>  src/glx/glxextensions.h | 10 ++++++++--
>  2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
> index 26ff804..93e8db5 100644
> --- a/src/glx/glxcmds.c
> +++ b/src/glx/glxcmds.c
> @@ -2646,7 +2646,11 @@ _X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
>   */
>  _X_EXPORT void (*glXGetProcAddress(const GLubyte * procName)) (void)
>  #if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
> +# if defined(USE_MGL_NAMESPACE)
> +   __attribute__ ((alias("mglXGetProcAddressARB")));
> +# else
>     __attribute__ ((alias("glXGetProcAddressARB")));
> +# endif
>  #else
>  {
>     return glXGetProcAddressARB(procName);
> diff --git a/src/glx/glxextensions.h b/src/glx/glxextensions.h
> index 90b173f..3a9bc82 100644
> --- a/src/glx/glxextensions.h
> +++ b/src/glx/glxextensions.h
> @@ -281,11 +281,17 @@ typedef void (*PFNGLXDISABLEEXTENSIONPROC) (const char *name);
>  # define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func)
>  #else
>  # if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
> -#  define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
> +/* GLX_ALIAS and GLX_ALIAS_VOID both expand to the macro GLX_ALIAS2. Using the
> + * extra expansion means that the name mangling macros in glx_mangle.h will
> + * apply before stringification, so the alias attribute will have a string like
> + * "mglXFoo" instead of "glXFoo". */
Hmm things are happening in quite Interesting order. On the good side,
we've been using the two layer macros in our dispatch (glapi) for a
while so things should be fully fixed now.

Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

Thank you for the fixes Kyle. I'll push the three patches tomorrow,
barring any objections of course.

-Emil


More information about the mesa-dev mailing list