Merge branch 'mesa_7_6_branch'
[mesa.git] / src / mesa / drivers / x11 / glxapi.c
index 5f11c90c13c3f8c2d5001aa7e9958cfe2a96e8f4..02eea25a7129a90aa616ddeae938b31af46db0fb 100644 (file)
@@ -34,8 +34,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include "glheader.h"
-#include "glapi.h"
+#include "main/glheader.h"
+#include "main/compiler.h"
+#include "glapi/glapi.h"
 #include "glxapi.h"
 
 
@@ -141,7 +142,7 @@ static void
 SetCurrentContext(GLXContext c)
 {
 #if defined(GLX_USE_TLS)
-   CurrentContext = context;
+   CurrentContext = c;
 #elif defined(THREADS)
    _glthread_SetTSD(&ContextTSD, c);
 #else
@@ -1169,7 +1170,7 @@ _glxapi_get_extensions(void)
 #ifdef GLX_SGIX_pbuffer
       "GLX_SGIX_pbuffer",
 #endif
-#ifdef GLX_EXT_texture_from_pixmap,
+#ifdef GLX_EXT_texture_from_pixmap
       "GLX_EXT_texture_from_pixmap",
 #endif
       NULL
@@ -1374,7 +1375,12 @@ _glxapi_get_proc_address(const char *funcName)
 {
    GLuint i;
    for (i = 0; GLX_functions[i].Name; i++) {
+#ifdef MANGLE
+      /* skip the "m" prefix on the name */
+      if (strcmp(GLX_functions[i].Name, funcName+1) == 0)
+#else
       if (strcmp(GLX_functions[i].Name, funcName) == 0)
+#endif
          return GLX_functions[i].Address;
    }
    return NULL;