[patch] Use dlsym instead of glXGetProcAddress in xdriinfo

Felix Kühling fxkuehl at gmx.de
Wed Nov 23 08:07:56 PST 2005


Am Mittwoch, den 23.11.2005, 07:27 -0800 schrieb Ian Romanick:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Eric Anholt wrote:
> 
> > @@ -57,8 +58,8 @@
> >      char *funcArg = NULL;
> >      char *dpyName = NULL;
> >  
> > -    GetScreenDriver = (glXGetScreenDriver_t *)glXGetProcAddress ("glXGetScreenDriver");
> > -    GetDriverConfig = (glXGetDriverConfig_t *)glXGetProcAddress ("glXGetDriverConfig");
> > +    GetScreenDriver = (glXGetScreenDriver_t *)glXGetProcAddressARB ("glXGetScreenDriver");
> > +    GetDriverConfig = (glXGetDriverConfig_t *)glXGetProcAddressARB ("glXGetDriverConfig");
> >      if (!GetScreenDriver || !GetDriverConfig) {
> >  	fprintf (stderr, "libGL is too old.\n");
> >  	return 1;
> 
> Actually, this code is totally bogus.  In X.org's default libGL,
> glXGetProcAddress *NEVER* returns NULL.  Ever.  Replace
> "glXGetScreenDriver" above with "glXLikesToSegfault" and you'll see what
> I mean. :)

IIRC the behaviour of glXGetProcAddress depends on the name of the
function your querying. For unknown glX... functions it actually
returned NULL last time I worked on this (about 2 years ago). I'll
verify this later.

Regards,
  Felix

-- 
| Felix Kühling <fxkuehl at gmx.de>                     http://fxk.de.vu |
| PGP Fingerprint: 6A3C 9566 5B30 DDED 73C3  B152 151C 5CC1 D888 E595 |




More information about the xorg mailing list