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

Kyle Brenneman kbrenneman at nvidia.com
Thu Sep 24 15:22:07 PDT 2015


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
---
 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)
 # else
 #  define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
    return_type  real_func  proto_args                                   \
-- 
1.9.1



More information about the mesa-dev mailing list