diff options
Diffstat (limited to 'xorg-server/glx/glxdricommon.c')
-rwxr-xr-x[-rw-r--r--] | xorg-server/glx/glxdricommon.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/xorg-server/glx/glxdricommon.c b/xorg-server/glx/glxdricommon.c index 79922154a..50e6419a2 100644..100755 --- a/xorg-server/glx/glxdricommon.c +++ b/xorg-server/glx/glxdricommon.c @@ -224,6 +224,14 @@ glxConvertConfigs(const __DRIcoreExtension * core, static const char dri_driver_path[] = DRI_DRIVER_PATH; +/* Temporary define to allow building without a dri_interface.h from + * updated Mesa. Some day when we don't care about Mesa that old any + * more this can be removed. + */ +#ifndef __DRI_DRIVER_GET_EXTENSIONS +#define __DRI_DRIVER_GET_EXTENSIONS "__driDriverGetExtensions" +#endif + void * glxProbeDriver(const char *driverName, void **coreExt, const char *coreName, int coreVersion, @@ -232,7 +240,8 @@ glxProbeDriver(const char *driverName, int i; void *driver; char filename[PATH_MAX]; - const __DRIextension **extensions; + char *get_extensions_name; + const __DRIextension **extensions = NULL; #ifdef _MSC_VER #define DLLNAME "%s%s_dri.dll" @@ -252,10 +261,25 @@ glxProbeDriver(const char *driverName, goto cleanup_failure; } + if (asprintf(&get_extensions_name, "%s_%s", + __DRI_DRIVER_GET_EXTENSIONS, driverName) != -1) { + const __DRIextension **(*get_extensions)(void); + +#ifdef _MSC_VER + get_extensions = (const __DRIextension **(*get_extensions)(void))GetProcAddress(driver, get_extensions_name); +#else + get_extensions = dlsym(driver, get_extensions_name); +#endif + if (get_extensions) + extensions = get_extensions(); + free(get_extensions_name); + } + + if (!extensions) #ifdef _MSC_VER - extensions = (const __DRIextension **)GetProcAddress(driver, __DRI_DRIVER_EXTENSIONS); + extensions = (const __DRIextension **)GetProcAddress(driver, __DRI_DRIVER_EXTENSIONS); #else - extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS); + extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS); #endif if (extensions == NULL) { LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n", @@ -286,7 +310,7 @@ glxProbeDriver(const char *driverName, cleanup_failure: if (driver) #ifdef _MSC_VER - FreeLibrary(driver); + FreeLibrary(driver); #else dlclose(driver); #endif |