aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libx11/vcxserver.patch
blob: 10a6312f927c66723c6e8099e6315d848c8685b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
diff --git a/include/X11/Xlib.h b/include/X11/Xlib.h
index 5faf83b..c6c63a3 100644
--- a/include/X11/Xlib.h
+++ b/include/X11/Xlib.h
@@ -79,7 +79,7 @@ _Xmblen(
 
 typedef char *XPointer;
 
-#define Bool int
-#define Status int
+typedef int Bool;
+typedef int Status;
 #define True 1
 #define False 0
diff --git a/src/CrGlCur.c b/src/CrGlCur.c
index 460660f..510ff5d 100644
--- a/src/CrGlCur.c
+++ b/src/CrGlCur.c
@@ -51,8 +51,14 @@ in this Software without prior written authorization from The Open Group.
 #if defined(hpux)
 typedef shl_t	XModuleType;
 #else
+#ifdef _MSC_VER
+#include <X11/XWindows.h>
+typedef HANDLE XModuleType;
+#define dlsym GetProcAddress
+#else
 typedef void *XModuleType;
 #endif
+#endif
 
 #ifndef LIBXCURSOR
 #define LIBXCURSOR "libXcursor.so.1"
@@ -70,8 +76,12 @@ open_library (void)
     {
 #if defined(hpux)
 	module = shl_load(library, BIND_DEFERRED, 0L);
+#else
+#ifdef _MSC_VER
+	module =  LoadLibrary(library);
 #else
 	module =  dlopen(library, RTLD_LAZY);
+#endif
 #endif
 	if (module)
 	    return module;
diff --git a/src/GetDflt.c b/src/GetDflt.c
index c9222a2..c6e1b25 100644
--- a/src/GetDflt.c
+++ b/src/GetDflt.c
@@ -137,9 +138,13 @@ InitDefaults(
      * ~/.Xdefaults.  Next, if there is an XENVIRONMENT environment variable,
      * then load that file.
      */
-
+     
     if (dpy->xdefaults == NULL) {
+	#ifdef _MSC_VER
+	const char *slashDotXdefaults = ".Xdefaults";
+	#else
 	const char *slashDotXdefaults = "/.Xdefaults";
+	#endif
 
 	(void) GetHomeDir (fname, (int) (PATH_MAX - strlen (slashDotXdefaults) - 1));
 	(void) strcat (fname, slashDotXdefaults);
@@ -149,7 +154,11 @@ InitDefaults(
     }
 
     if (!(xenv = getenv ("XENVIRONMENT"))) {
+	#ifdef _MSC_VER
+	const char *slashDotXdefaultsDash = ".Xdefaults-";
+	#else
 	const char *slashDotXdefaultsDash = "/.Xdefaults-";
+	#endif
 	int len;
 
 	(void) GetHomeDir (fname, (int) (PATH_MAX - strlen (slashDotXdefaultsDash) - 1));
    diff --git a/src/SetLocale.c b/src/SetLocale.c
index 81f4a7c..cb52f11 100644
--- a/src/SetLocale.c
+++ b/src/SetLocale.c
@@ -63,11 +63,11 @@ from The Open Group.
 #include <X11/Xlocale.h>
 #include <X11/Xos.h>
 #include "XlcPubI.h"
 
 #define MAXLOCALE	64	/* buffer size of locale name */
 
 
-#if defined(__APPLE__) || defined(__CYGWIN__)
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(_MSC_VER)
 char *
 _Xsetlocale(
     int           category,
diff --git a/src/StrKeysym.c b/src/StrKeysym.c
index be77a93..6967bcc 100644
--- a/src/StrKeysym.c
+++ b/src/StrKeysym.c
@@ -39,12 +39,12 @@ in this Software without prior written authorization from The Open Group.
 
 #ifndef KEYSYMDB
 #ifndef XKEYSYMDB
-#define KEYSYMDB "/usr/lib/X11/XKeysymDB"
+#define KEYSYMDB "XKeysymDB"
 #else
 #define KEYSYMDB XKEYSYMDB
 #endif
 #endif
 
 static Bool initialized;
 static XrmDatabase keysymdb;
 static XrmQuark Qkeysym[2];
diff --git a/src/xlibi18n/lcDynamic.c b/src/xlibi18n/lcDynamic.c
index 3821bff..a50aa70 100644
--- a/src/xlibi18n/lcDynamic.c
+++ b/src/xlibi18n/lcDynamic.c
@@ -51,7 +51,7 @@ from The Open Group.
 #include "Xlcint.h"
 
 #ifndef XLOCALEDIR
-#define XLOCALEDIR "/usr/lib/X11/locale"
+#define XLOCALEDIR "locale"
 #endif
 
 #define LCLIBNAME    "xi18n.so"
diff --git a/src/xlibi18n/lcFile.c b/src/xlibi18n/lcFile.c
index 25cabd5..819ac89 100644
--- a/src/xlibi18n/lcFile.c
+++ b/src/xlibi18n/lcFile.c
@@ -195,7 +192,7 @@ _XlcParsePath(
 }
 
 #ifndef XLOCALEDIR
-#define XLOCALEDIR "/usr/lib/X11/locale"
+#define XLOCALEDIR "locale"
 #endif
 
 void