diff options
Diffstat (limited to 'xorg-server/glx/glxdricommon.c')
-rw-r--r-- | xorg-server/glx/glxdricommon.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/xorg-server/glx/glxdricommon.c b/xorg-server/glx/glxdricommon.c index b027f2498..79922154a 100644 --- a/xorg-server/glx/glxdricommon.c +++ b/xorg-server/glx/glxdricommon.c @@ -25,6 +25,10 @@ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> +#else + +#include "glheader.h" + #endif #include <stdint.h> @@ -40,6 +44,10 @@ #include "glxscreens.h" #include "glxdricommon.h" +#ifdef _MSC_VER +#define dlerror() "Getting loadlibrary error string not implemented" +#endif + static int getUST(int64_t * ust) { @@ -48,6 +56,10 @@ getUST(int64_t * ust) if (ust == NULL) return -EFAULT; +#ifdef _MSC_VER + DebugBreak(); + return -EFAULT; +#else if (gettimeofday(&tv, NULL) == 0) { ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec; return 0; @@ -55,6 +67,7 @@ getUST(int64_t * ust) else { return -errno; } +#endif } const __DRIsystemTimeExtension systemTimeExtension = { @@ -221,17 +234,29 @@ glxProbeDriver(const char *driverName, char filename[PATH_MAX]; const __DRIextension **extensions; +#ifdef _MSC_VER +#define DLLNAME "%s%s_dri.dll" + snprintf(filename, sizeof filename, DLLNAME, + dri_driver_path, driverName); + + driver = LoadLibrary(filename); +#else snprintf(filename, sizeof filename, "%s/%s_dri.so", dri_driver_path, driverName); driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); +#endif if (driver == NULL) { LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n", filename, dlerror()); goto cleanup_failure; } +#ifdef _MSC_VER + extensions = (const __DRIextension **)GetProcAddress(driver, __DRI_DRIVER_EXTENSIONS); +#else extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS); +#endif if (extensions == NULL) { LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n", driverName, dlerror()); @@ -260,7 +285,11 @@ glxProbeDriver(const char *driverName, cleanup_failure: if (driver) +#ifdef _MSC_VER + FreeLibrary(driver); +#else dlclose(driver); +#endif *coreExt = *renderExt = NULL; return NULL; } |