There were two problems with this typedef. First, we don't actually
need it, (we define it here and then use it exactly once on the next
line---it's simpler to have the direct syntax for a function returning
a pointer to a function accepting void and returning void.
More importantly, the typedef was relying on the type __GLXextFuncPtr
being defined. This happens to work with Mesa on my system but is
inherently fragile. So the code is more robust not relying on this.
metrics_end_frame ();
}
-
-typedef __GLXextFuncPtr (* fips_glXGetProcAddressARB_t)(const GLubyte *func);
-__GLXextFuncPtr
-glXGetProcAddressARB (const GLubyte *func)
+/* glXGetProcAddressARB is a function which accepts a string and
+ * returns a generic function pointer (which nominall 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.
+ */
+void (*glXGetProcAddressARB (const GLubyte *func))(void)
{
- __GLXextFuncPtr ptr;
- static fips_glXGetProcAddressARB_t glxwrap_real_glXGetProcAddressARB = NULL;
+ void *ptr;
+ static typeof(&glXGetProcAddressARB) glxwrap_real_glXGetProcAddressARB = NULL;
char *name = "glXGetProcAddressARB";
if (! glxwrap_real_glXGetProcAddressARB) {