aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx')
-rw-r--r--xorg-server/glx/glheader.h24
-rw-r--r--xorg-server/glx/glxcmds.c4
-rw-r--r--xorg-server/glx/glxcmdsswap.c4
-rw-r--r--xorg-server/glx/glxdri.c3
-rw-r--r--xorg-server/glx/glxdricommon.c8
-rw-r--r--xorg-server/glx/glxdriswrast.c24
-rw-r--r--xorg-server/glx/glxext.c4
-rw-r--r--xorg-server/glx/glxscreens.c4
-rw-r--r--xorg-server/glx/glxserver.h1
-rw-r--r--xorg-server/glx/indirect_dispatch.c7
-rw-r--r--xorg-server/glx/indirect_dispatch_swap.c7
-rw-r--r--xorg-server/glx/indirect_program.c4
-rw-r--r--xorg-server/glx/indirect_reqsize.c7
-rw-r--r--xorg-server/glx/indirect_size_get.c9
-rw-r--r--xorg-server/glx/indirect_table.c4
-rw-r--r--xorg-server/glx/indirect_texture_compression.c4
-rw-r--r--xorg-server/glx/indirect_util.c4
-rw-r--r--xorg-server/glx/makefile7
-rw-r--r--xorg-server/glx/render2.c4
-rw-r--r--xorg-server/glx/render2swap.c4
-rw-r--r--xorg-server/glx/renderpix.c4
-rw-r--r--xorg-server/glx/renderpixswap.c4
-rw-r--r--xorg-server/glx/rensize.c10
-rw-r--r--xorg-server/glx/single2.c4
-rw-r--r--xorg-server/glx/single2swap.c4
-rw-r--r--xorg-server/glx/singlepix.c4
-rw-r--r--xorg-server/glx/singlepixswap.c4
-rw-r--r--xorg-server/glx/singlesize.c4
-rw-r--r--xorg-server/glx/swap_interval.c6
-rw-r--r--xorg-server/glx/xfont.c4
30 files changed, 184 insertions, 1 deletions
diff --git a/xorg-server/glx/glheader.h b/xorg-server/glx/glheader.h
new file mode 100644
index 000000000..1c0ee2c9e
--- /dev/null
+++ b/xorg-server/glx/glheader.h
@@ -0,0 +1,24 @@
+#ifndef __GLHEADER_H__
+#define __GLHEADER_H__
+
+#define STDC_HEADERS 1
+
+#include <X11/Xwinsock.h>
+#include <X11/Xwindows.h>
+#include <assert.h>
+#define strcasecmp _stricmp
+
+#undef MINSHORT
+#undef MAXSHORT
+
+#define MINSHORT -32768
+#define MAXSHORT 32767
+
+#define PUBLIC
+
+#define GL_GLEXT_PROTOTYPES
+
+#define DRI_DRIVER_PATH "/usr/lib/dri"
+
+#endif
+
diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c
index f5632d162..6723297c9 100644
--- a/xorg-server/glx/glxcmds.c
+++ b/xorg-server/glx/glxcmds.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
diff --git a/xorg-server/glx/glxcmdsswap.c b/xorg-server/glx/glxcmdsswap.c
index f1c0ce69f..2f74ce5ec 100644
--- a/xorg-server/glx/glxcmdsswap.c
+++ b/xorg-server/glx/glxcmdsswap.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
diff --git a/xorg-server/glx/glxdri.c b/xorg-server/glx/glxdri.c
index c9d226bdf..bcb62ecf4 100644
--- a/xorg-server/glx/glxdri.c
+++ b/xorg-server/glx/glxdri.c
@@ -29,10 +29,13 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#ifndef _MSC_VER
#include <sys/time.h>
#include <dlfcn.h>
#include <drm.h>
+#endif
+
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
diff --git a/xorg-server/glx/glxdricommon.c b/xorg-server/glx/glxdricommon.c
index faaa3b7ae..028c77842 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>
@@ -47,12 +51,16 @@ getUST(int64_t *ust)
if (ust == NULL)
return -EFAULT;
+#ifdef _MSC_VER
+ __asm int 3;
+#else
if (gettimeofday(&tv, NULL) == 0) {
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
return 0;
} else {
return -errno;
}
+ #endif
}
const __DRIsystemTimeExtension systemTimeExtension = {
diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c
index 44f658fa9..b5d707a21 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>
@@ -62,6 +66,10 @@
#endif
#endif
+#ifdef _MSC_VER
+#define dlerror() "Getting loadlibrary error string not implemented"
+#endif
+
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
@@ -250,7 +258,11 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
(*screen->core->destroyScreen)(screen->driScreen);
+#ifdef _MSC_VER
+ FreeLibrary(screen->driver);
+#else
dlclose(screen->driver);
+#endif
__glXScreenDestroy(baseScreen);
@@ -461,14 +473,22 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
snprintf(filename, sizeof filename,
"%s/%s_dri.so", dri_driver_path, driverName);
+#ifdef _MSC_VER
+ screen->driver = LoadLibrary(filename);
+#else
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+#endif
if (screen->driver == NULL) {
LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
filename, dlerror());
goto handle_error;
}
+#ifdef _MSC_VER
+ extensions = GetProcAddress(screen->driver, __DRI_DRIVER_EXTENSIONS);
+#else
extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
+#endif
if (extensions == NULL) {
LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
driverName, dlerror());
@@ -517,7 +537,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
handle_error:
if (screen->driver)
+#ifdef _MSC_VER
+ FreeLibrary(screen->driver);
+#else
dlclose(screen->driver);
+#endif
xfree(screen);
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c
index 19d70d495..95f09d296 100644
--- a/xorg-server/glx/glxext.c
+++ b/xorg-server/glx/glxext.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
diff --git a/xorg-server/glx/glxscreens.c b/xorg-server/glx/glxscreens.c
index 81faddd04..fe7b22d96 100644
--- a/xorg-server/glx/glxscreens.c
+++ b/xorg-server/glx/glxscreens.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <GL/glxtokens.h>
diff --git a/xorg-server/glx/glxserver.h b/xorg-server/glx/glxserver.h
index 46c938268..49e6ab30c 100644
--- a/xorg-server/glx/glxserver.h
+++ b/xorg-server/glx/glxserver.h
@@ -54,6 +54,7 @@
#define GL_GLEXT_PROTOTYPES /* we want prototypes */
#include <GL/gl.h>
+#include <GL/glext.h>
#include <GL/glxproto.h>
/* For glxscreens.h */
diff --git a/xorg-server/glx/indirect_dispatch.c b/xorg-server/glx/indirect_dispatch.c
index 666551903..1da14750d 100644
--- a/xorg-server/glx/indirect_dispatch.c
+++ b/xorg-server/glx/indirect_dispatch.c
@@ -24,6 +24,13 @@
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
#include <X11/Xmd.h>
#include <GL/gl.h>
diff --git a/xorg-server/glx/indirect_dispatch_swap.c b/xorg-server/glx/indirect_dispatch_swap.c
index 3221c809d..64d9dc99b 100644
--- a/xorg-server/glx/indirect_dispatch_swap.c
+++ b/xorg-server/glx/indirect_dispatch_swap.c
@@ -24,6 +24,13 @@
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
#include <X11/Xmd.h>
#include <GL/gl.h>
diff --git a/xorg-server/glx/indirect_program.c b/xorg-server/glx/indirect_program.c
index 237da2908..165d12bd9 100644
--- a/xorg-server/glx/indirect_program.c
+++ b/xorg-server/glx/indirect_program.c
@@ -31,6 +31,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/indirect_reqsize.c b/xorg-server/glx/indirect_reqsize.c
index 35bb9370f..ed64d0f46 100644
--- a/xorg-server/glx/indirect_reqsize.c
+++ b/xorg-server/glx/indirect_reqsize.c
@@ -25,6 +25,13 @@
* SOFTWARE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
#include <GL/gl.h>
#include "glxserver.h"
diff --git a/xorg-server/glx/indirect_size_get.c b/xorg-server/glx/indirect_size_get.c
index 80f81dec6..7b8fa49cd 100644
--- a/xorg-server/glx/indirect_size_get.c
+++ b/xorg-server/glx/indirect_size_get.c
@@ -25,6 +25,13 @@
* SOFTWARE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
#include <GL/gl.h>
#include "indirect_size_get.h"
@@ -888,7 +895,9 @@ __glGetTexLevelParameterfv_size(GLenum e)
case GL_TEXTURE_INTENSITY_SIZE:
/* case GL_TEXTURE_INTENSITY_SIZE_EXT:*/
case GL_TEXTURE_DEPTH:
+#ifndef _MSC_VER
case GL_TEXTURE_INDEX_SIZE_EXT:
+#endif
case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
/* case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB:*/
case GL_TEXTURE_COMPRESSED:
diff --git a/xorg-server/glx/indirect_table.c b/xorg-server/glx/indirect_table.c
index cb3202605..b5ac86a5a 100644
--- a/xorg-server/glx/indirect_table.c
+++ b/xorg-server/glx/indirect_table.c
@@ -25,6 +25,10 @@
* SOFTWARE.
*/
+#ifndef HAVE_DIX_CONFIG_H
+#include "glheader.h"
+#endif
+
#include <inttypes.h>
#include "glxserver.h"
#include "glxext.h"
diff --git a/xorg-server/glx/indirect_texture_compression.c b/xorg-server/glx/indirect_texture_compression.c
index 25c6eb30e..f20ebc8af 100644
--- a/xorg-server/glx/indirect_texture_compression.c
+++ b/xorg-server/glx/indirect_texture_compression.c
@@ -25,6 +25,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/indirect_util.c b/xorg-server/glx/indirect_util.c
index 44309104e..2f48ab2b0 100644
--- a/xorg-server/glx/indirect_util.c
+++ b/xorg-server/glx/indirect_util.c
@@ -25,6 +25,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
diff --git a/xorg-server/glx/makefile b/xorg-server/glx/makefile
new file mode 100644
index 000000000..0debc92a0
--- /dev/null
+++ b/xorg-server/glx/makefile
@@ -0,0 +1,7 @@
+CSRCS=glapi.c glthread.c glxcmds.c glxcmdsswap.c glxdricommon.c glxext.c glxscreens.c \
+indirect_dispatch.c indirect_dispatch_swap.c indirect_program.c indirect_reqsize.c indirect_size_get.c indirect_table.c indirect_texture_compression.c \
+indirect_util.c render2.c render2swap.c renderpix.c renderpixswap.c rensize.c single2.c single2swap.c singlepix.c singlepixswap.c singlesize.c \
+swap_interval.c xfont.c glxdriswrast.c
+
+LIBRARY=libglx
+
diff --git a/xorg-server/glx/render2.c b/xorg-server/glx/render2.c
index eb7c30ba0..32cee4160 100644
--- a/xorg-server/glx/render2.c
+++ b/xorg-server/glx/render2.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <glxserver.h>
diff --git a/xorg-server/glx/render2swap.c b/xorg-server/glx/render2swap.c
index 17354c4f8..59cb93a6a 100644
--- a/xorg-server/glx/render2swap.c
+++ b/xorg-server/glx/render2swap.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/renderpix.c b/xorg-server/glx/renderpix.c
index 056e62c87..3e5612036 100644
--- a/xorg-server/glx/renderpix.c
+++ b/xorg-server/glx/renderpix.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/renderpixswap.c b/xorg-server/glx/renderpixswap.c
index 9cd57410e..a73ed1e3c 100644
--- a/xorg-server/glx/renderpixswap.c
+++ b/xorg-server/glx/renderpixswap.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/rensize.c b/xorg-server/glx/rensize.c
index 8a58e08d7..6b85dc116 100644
--- a/xorg-server/glx/rensize.c
+++ b/xorg-server/glx/rensize.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <GL/gl.h>
@@ -219,7 +223,9 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target,
case GL_422_AVERAGE_EXT:
case GL_422_REV_AVERAGE_EXT:
case GL_DEPTH_STENCIL_NV:
+#ifndef _MSC_VER
case GL_DEPTH_STENCIL_MESA:
+#endif
case GL_YCBCR_MESA:
case GL_LUMINANCE_ALPHA:
elementsPerGroup = 2;
@@ -258,11 +264,13 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target,
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
case GL_UNSIGNED_SHORT_8_8_APPLE:
case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
+#ifndef _MSC_VER
case GL_UNSIGNED_SHORT_15_1_MESA:
case GL_UNSIGNED_SHORT_1_15_REV_MESA:
bytesPerElement = 2;
elementsPerGroup = 1;
break;
+#endif
case GL_INT:
case GL_UNSIGNED_INT:
case GL_FLOAT:
@@ -273,8 +281,10 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target,
case GL_UNSIGNED_INT_10_10_10_2:
case GL_UNSIGNED_INT_2_10_10_10_REV:
case GL_UNSIGNED_INT_24_8_NV:
+#ifndef _MSC_VER
case GL_UNSIGNED_INT_24_8_MESA:
case GL_UNSIGNED_INT_8_24_REV_MESA:
+#endif
bytesPerElement = 4;
elementsPerGroup = 1;
break;
diff --git a/xorg-server/glx/single2.c b/xorg-server/glx/single2.c
index 50a59ed71..f6e474c46 100644
--- a/xorg-server/glx/single2.c
+++ b/xorg-server/glx/single2.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
diff --git a/xorg-server/glx/single2swap.c b/xorg-server/glx/single2swap.c
index cf83bdc88..e27e97aee 100644
--- a/xorg-server/glx/single2swap.c
+++ b/xorg-server/glx/single2swap.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/singlepix.c b/xorg-server/glx/singlepix.c
index a0a6a7918..656f1ec5e 100644
--- a/xorg-server/glx/singlepix.c
+++ b/xorg-server/glx/singlepix.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/singlepixswap.c b/xorg-server/glx/singlepixswap.c
index a7febc9a6..c7d2d1562 100644
--- a/xorg-server/glx/singlepixswap.c
+++ b/xorg-server/glx/singlepixswap.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/singlesize.c b/xorg-server/glx/singlesize.c
index 9e95dd3d3..a9a2be66b 100644
--- a/xorg-server/glx/singlesize.c
+++ b/xorg-server/glx/singlesize.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <GL/gl.h>
diff --git a/xorg-server/glx/swap_interval.c b/xorg-server/glx/swap_interval.c
index 3a5242022..03f83cb89 100644
--- a/xorg-server/glx/swap_interval.c
+++ b/xorg-server/glx/swap_interval.c
@@ -24,6 +24,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
@@ -53,7 +57,7 @@ int DoSwapInterval(__GLXclientState *cl, GLbyte *pc, int do_swap)
cx = __glXLookupContextByTag(cl, tag);
- LogMessage(X_ERROR, "%s: cx = %p, GLX screen = %p\n", __func__,
+ LogMessage(X_ERROR, "%s: cx = %p, GLX screen = %p\n", __FUNCTION__ ,
cx, (cx == NULL) ? NULL : cx->pGlxScreen);
if ((cx == NULL) || (cx->pGlxScreen == NULL)) {
client->errorValue = tag;
diff --git a/xorg-server/glx/xfont.c b/xorg-server/glx/xfont.c
index b8b466d87..2af5996f3 100644
--- a/xorg-server/glx/xfont.c
+++ b/xorg-server/glx/xfont.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"