aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx/glxdriswrast.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx/glxdriswrast.c')
-rw-r--r--xorg-server/glx/glxdriswrast.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c
index d064a0536..0c967b2a3 100644
--- a/xorg-server/glx/glxdriswrast.c
+++ b/xorg-server/glx/glxdriswrast.c
@@ -26,6 +26,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <stdint.h>
@@ -54,13 +58,6 @@
#include "dispatch.h"
#include "extension_string.h"
-/* RTLD_LOCAL is not defined on Cygwin */
-#ifdef __CYGWIN__
-#ifndef RTLD_LOCAL
-#define RTLD_LOCAL 0
-#endif
-#endif
-
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
@@ -247,7 +244,11 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
(*screen->core->destroyScreen)(screen->driScreen);
+#ifdef _MSC_VER
+ FreeLibrary(screen->driver);
+#else
dlclose(screen->driver);
+#endif
__glXScreenDestroy(baseScreen);
@@ -430,11 +431,18 @@ initializeExtensions(__GLXDRIscreen *screen)
}
}
+extern Bool g_fswrastwgl;
+
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{
- const char *driverName = "swrast";
+ const char *driverName;
__GLXDRIscreen *screen;
+
+ if (g_fswrastwgl)
+ driverName = "swrastwgl";
+ else
+ driverName = "swrast";
screen = calloc(1, sizeof *screen);
if (screen == NULL)
@@ -486,7 +494,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
handle_error:
if (screen->driver)
+#ifdef _MSC_VER
+ FreeLibrary(screen->driver);
+#else
dlclose(screen->driver);
+#endif
free(screen);