summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gottwald <ago@freedesktop.org>2004-11-15 15:06:54 +0000
committerAlexander Gottwald <ago@freedesktop.org>2004-11-15 15:06:54 +0000
commitf3d83ee153f42e8899b844377e6b842d93411e62 (patch)
tree1875c28c12588466e18fc0e73dc1f8cfed9ea82b
parentb798ea11911ac58a8e6e7d15a2a643b023859749 (diff)
downloadxorg-lib-libX11-f3d83ee153f42e8899b844377e6b842d93411e62.tar.gz
Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 Added mingw (Win32) port
-rw-r--r--modules/im/ximcp/imTrans.c4
-rw-r--r--src/ConnDis.c4
-rw-r--r--src/OpenDis.c4
-rw-r--r--src/XlibInt.c26
-rw-r--r--src/xlibi18n/lcFile.c41
5 files changed, 73 insertions, 6 deletions
diff --git a/modules/im/ximcp/imTrans.c b/modules/im/ximcp/imTrans.c
index 6857231e..2da2d686 100644
--- a/modules/im/ximcp/imTrans.c
+++ b/modules/im/ximcp/imTrans.c
@@ -41,6 +41,10 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "XimTrans.h"
#include "XimTrInt.h"
+#ifdef WIN32
+#include <X11/Xwindows.h>
+#endif
+
#ifndef XIM_CONNECTION_RETRIES
#define XIM_CONNECTION_RETRIES 5
diff --git a/src/ConnDis.c b/src/ConnDis.c
index e744559a..ca48ba07 100644
--- a/src/ConnDis.c
+++ b/src/ConnDis.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: lib/X11/src/ConnDis.c,v 1.5 2004-07-27 06:06:05 herrb Exp $ */
+/* $XdotOrg: lib/X11/src/ConnDis.c,v 1.6 2004-11-15 15:06:54 ago Exp $ */
/* $Xorg: ConnDis.c,v 1.8 2001/02/09 02:03:31 xorgcvs Exp $ */
/*
@@ -46,6 +46,8 @@ in this Software without prior written authorization from The Open Group.
#else
#include <socket.h>
#endif
+#else
+#include <X11/Xwindows.h>
#endif
#ifndef X_CONNECTION_RETRIES /* number retries on ECONNREFUSED */
diff --git a/src/OpenDis.c b/src/OpenDis.c
index 78d56f65..ea37260a 100644
--- a/src/OpenDis.c
+++ b/src/OpenDis.c
@@ -53,10 +53,6 @@ typedef struct {
int opcode;
} _XBigReqState;
-#ifdef WIN32
-int *_Xdebug_p = &_Xdebug;
-#endif
-
#ifdef XTHREADS
#include "locking.h"
int (*_XInitDisplayLock_fn)(Display *dpy) = NULL;
diff --git a/src/XlibInt.c b/src/XlibInt.c
index b9da8d72..c64ea9c7 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -35,11 +35,17 @@ from The Open Group.
#define NEED_EVENTS
#define NEED_REPLIES
+#ifdef WIN32
+#define _XLIBINT_
+#endif
#include "Xlibint.h"
#include <X11/Xpoll.h>
#include <X11/Xtrans.h>
#include <X11/extensions/xcmiscstr.h>
#include <stdio.h>
+#ifdef WIN32
+#include <direct.h>
+#endif
#ifdef XTHREADS
#include "locking.h"
@@ -3398,3 +3404,23 @@ int _XAccessFile(path)
#endif
+#ifdef WIN32
+#undef _Xdebug
+int _Xdebug = 0;
+int *_Xdebug_p = &_Xdebug;
+void (**_XCreateMutex_fn_p)(LockInfoPtr) = &_XCreateMutex_fn;
+void (**_XFreeMutex_fn_p)(LockInfoPtr) = &_XFreeMutex_fn;
+void (**_XLockMutex_fn_p)(LockInfoPtr
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char * /* file */
+ , int /* line */
+#endif
+ ) = &_XLockMutex_fn;
+void (**_XUnlockMutex_fn_p)(LockInfoPtr
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char * /* file */
+ , int /* line */
+#endif
+ ) = &_XUnlockMutex_fn;
+LockInfoPtr *_Xglobal_lock_p = &_Xglobal_lock;
+#endif
diff --git a/src/xlibi18n/lcFile.c b/src/xlibi18n/lcFile.c
index 66df63f5..1e8407b4 100644
--- a/src/xlibi18n/lcFile.c
+++ b/src/xlibi18n/lcFile.c
@@ -150,6 +150,41 @@ parse_line1(
return argc;
}
+#elif defined(WIN32)
+
+/* this is parse_line but skips drive letters at the beginning of the entry */
+static int
+parse_line1(
+ char *line,
+ char **argv,
+ int argsize)
+{
+ int argc = 0;
+ char *p = line;
+
+ while (argc < argsize) {
+ while (isspace(*p)) {
+ ++p;
+ }
+ if (*p == '\0') {
+ break;
+ }
+ argv[argc++] = p;
+ if (isalpha(*p) && p[1] == ':') {
+ p+= 2; /* skip drive letters */
+ }
+ while (*p != ':' && *p != '\n' && *p != '\0') {
+ ++p;
+ }
+ if (*p == '\0') {
+ break;
+ }
+ *p++ = '\0';
+ }
+
+ return argc;
+}
+
#endif /* __UNIXOS2__ */
/* Splits a colon separated list of directories, and returns the constituent
@@ -164,7 +199,7 @@ _XlcParsePath(
char *p = path;
int n, i;
-#ifndef __UNIXOS2__
+#if !defined(__UNIXOS2__) && !defined(WIN32)
n = parse_line(path, argv, argsize);
#else
n = parse_line1(path, argv, argsize);
@@ -200,6 +235,7 @@ xlocaledir(
dir = getenv("XLOCALEDIR");
if (dir) {
+#ifndef WIN32
/*
* Only use the user-supplied path if the process isn't priviledged.
*/
@@ -235,6 +271,9 @@ xlocaledir(
}
#endif
}
+#else
+ priv = 0;
+#endif
if (!priv) {
len = strlen(dir);
strncpy(p, dir, buf_len);