<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 09/28/2015 11:26 AM, Emil Velikov wrote:<br>
<blockquote
cite="mid:CACvgo51beuY5DK9cy+6Fw94hTCx+TUJ3WpLJiKeRaELZmcZh8g@mail.gmail.com"
type="cite">
<pre wrap="">Hi Kyle,
On 24 September 2015 at 23:22, Kyle Brenneman <a class="moz-txt-link-rfc2396E" href="mailto:kbrenneman@nvidia.com"><kbrenneman@nvidia.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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: <a class="moz-txt-link-freetext" href="https://bugs.freedesktop.org/show_bug.cgi?id=55552">https://bugs.freedesktop.org/show_bug.cgi?id=55552</a>
</pre>
</blockquote>
<pre wrap="">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" <a class="moz-txt-link-rfc2396E" href="mailto:mesa-stable@lists.freedesktop.org"><mesa-stable@lists.freedesktop.org></a>
</pre>
<blockquote type="cite">
<pre wrap="">---
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)
</pre>
</blockquote>
<pre wrap="">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 ?</pre>
</blockquote>
No, it uses an extra layer of expansion. The GLX_ALIAS macro expands
to to GLX_ALIAS2, which in turn expands to the declaration with the
alias attribute. That extra expansion means that the string will
pick up the macros in glx_mangle.h. With only a single expansion,
glXGetCurrentDisplayEXT would expand to use the string
"glXGetCurrentDisplay", but with two, it gets
"mglXGetCurrentDisplay".<br>
<br>
That's also why GLX_ALIAS_VOID worked before but GLX_ALIAS didn't.<br>
<br>
Anyway, I added a comment next to them to clarify why it uses the
nested macros. Hopefully that makes it easier to read.<br>
<blockquote
cite="mid:CACvgo51beuY5DK9cy+6Fw94hTCx+TUJ3WpLJiKeRaELZmcZh8g@mail.gmail.com"
type="cite">
<pre wrap="">
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
</pre>
</blockquote>
<br>
</body>
</html>