Commit f3d83ee1 authored by Alexander Gottwald's avatar Alexander Gottwald

Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 Added mingw (Win32) port

parent b798ea11
......@@ -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
......
/* $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 */
......
......@@ -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;
......
......@@ -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
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment