]> git.cworth.org Git - fips/commitdiff
glxwraps: Fix fips for programs that call glXGetProcAddress
authorCarl Worth <cworth@cworth.org>
Thu, 27 Jun 2013 21:40:17 +0000 (14:40 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 27 Jun 2013 21:40:17 +0000 (14:40 -0700)
Previously, fips would work for programs calling glXGetProcAddressARB
but not for programs calling glXGetProcAddress.

Thanks to the recently-added test suite for noticing this bug.

glxwrap.c

index 799a0190f794de1a63346c372f17b2148835879d..d7d4191ce528ae5b59c5f8a9317b8e99a179d679 100644 (file)
--- a/glxwrap.c
+++ b/glxwrap.c
@@ -40,7 +40,7 @@ glXSwapBuffers (Display *dpy, GLXDrawable drawable)
 }
 
 /* glXGetProcAddressARB is a function which accepts a string and
- * returns a generic function pointer (which nominall accepts void and
+ * returns a generic function pointer (which nominally accepts void and
  * has void return type). Of course, the user is expected to cast the
  * returned function pointer to a function pointer of the expected
  * type.
@@ -60,6 +60,17 @@ void (*glXGetProcAddressARB (const GLubyte *func))(void)
        return ret;
 }
 
+void (*glXGetProcAddress (const GLubyte *func))(void)
+{
+       /* This comment must not be removed. It ensures that the
+        * glXGetProcAddress function ends up in our exported symbol
+        * list even though there's not otherwise any code saying:
+        *
+        * GLWRAP_DEFER_WITH_RETURN (ret, glXGetProcAddress, func);
+        */
+       return glXGetProcAddressARB(func);
+}
+
 Bool
 glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx)
 {