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

Emil Velikov emil.l.velikov at gmail.com
Mon Sep 28 10:26:47 PDT 2015


Hi Kyle,

On 24 September 2015 at 23:22, 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.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55552
Thanks for fixing this. It has been broken for ages.

Can you please add your s-o-b line as well as
Cc: "10.6 11.0" <mesa-stable at lists.freedesktop.org>

> ---
>  src/glx/glxcmds.c       | 4 ++++
>  src/glx/glxextensions.h | 6 ++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
> index 8164cd9..976ee36 100644
> --- a/src/glx/glxcmds.c
> +++ b/src/glx/glxcmds.c
> @@ -2666,7 +2666,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 8436a94..c4d4a17 100644
> --- a/src/glx/glxextensions.h
> +++ b/src/glx/glxextensions.h
> @@ -279,11 +279,13 @@ 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) \
> +#  define GLX_ALIAS2(return_type, real_func, proto_args, args, aliased_func) \
>     return_type  real_func  proto_args                                   \
>     __attribute__ ((alias( # aliased_func ) ));
> +#  define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
> +   GLX_ALIAS2(return_type, real_func, proto_args, args, aliased_func)
>  #  define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
> -   GLX_ALIAS(void, real_func, proto_args, args, aliased_func)
> +   GLX_ALIAS2(void, real_func, proto_args, args, aliased_func)
I'm having some serious eye-hurt with these lovely macros and for the
sake of me cannot see how this works. Are re undefining GLX_ALIAS
elsewhere ?

As a follow-up one can check, if we can remove the alias-unsupported
case and alternatively unify HAVE_ALIAS and GLX_ALIAS_UNSUPPORTED, and
use them consistently. Neither one is obviously obviously criteria for
this patch's acceptable :-)

Thanks
Emil


More information about the mesa-dev mailing list