Magellan Linux

Annotation of /trunk/tigervnc/patches/tigervnc-1.1.0-xserver112.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1961 - (hide annotations) (download)
Mon Nov 19 09:35:08 2012 UTC (11 years, 6 months ago) by niro
File size: 11911 byte(s)
-fix build against xorg-1.12
1 niro 1961 diff -up xserver/hw/vnc/vncExtInit.cc.xorg112 xserver/hw/vnc/vncExtInit.cc
2     --- xserver/hw/vnc/vncExtInit.cc.xorg112 2011-08-09 23:16:36.000000000 +0200
3     +++ xserver/hw/vnc/vncExtInit.cc 2012-03-27 12:54:56.937271323 +0200
4     @@ -56,6 +56,7 @@ extern "C" {
5     #include "XserverDesktop.h"
6     #include "vncHooks.h"
7     #include "vncExtInit.h"
8     +#include "xorg-version.h"
9    
10     extern "C" {
11    
12     @@ -360,10 +361,16 @@ void vncClientCutText(const char* str, i
13     ev.window = cur->window;
14     ev.time = GetTimeInMillis();
15     if (cur->client->swapped) {
16     +#if XORG < 112
17     int n;
18     swaps(&ev.sequenceNumber, n);
19     swapl(&ev.window, n);
20     swapl(&ev.time, n);
21     +#else
22     + swaps(&ev.sequenceNumber);
23     + swapl(&ev.window);
24     + swapl(&ev.time);
25     +#endif
26     }
27     WriteToClient(cur->client, sizeof(xVncExtClientCutTextNotifyEvent),
28     (char *)&ev);
29     @@ -406,9 +413,14 @@ void vncQueryConnect(XserverDesktop* des
30     ev.sequenceNumber = cur->client->sequence;
31     ev.window = cur->window;
32     if (cur->client->swapped) {
33     +#if XORG < 112
34     int n;
35     swaps(&ev.sequenceNumber, n);
36     swapl(&ev.window, n);
37     +#else
38     + swaps(&ev.sequenceNumber);
39     + swapl(&ev.window);
40     +#endif
41     }
42     WriteToClient(cur->client, sizeof(xVncExtQueryConnectNotifyEvent),
43     (char *)&ev);
44     @@ -449,10 +461,16 @@ static void SendSelectionChangeEvent(Ato
45     ev.window = cur->window;
46     ev.selection = selection;
47     if (cur->client->swapped) {
48     +#if XORG < 112
49     int n;
50     swaps(&ev.sequenceNumber, n);
51     swapl(&ev.window, n);
52     swapl(&ev.selection, n);
53     +#else
54     + swaps(&ev.sequenceNumber);
55     + swapl(&ev.window);
56     + swapl(&ev.selection);
57     +#endif
58     }
59     WriteToClient(cur->client, sizeof(xVncExtSelectionChangeNotifyEvent),
60     (char *)&ev);
61     @@ -473,7 +491,6 @@ static int ProcVncExtSetParam(ClientPtr
62     param.buf[stuff->paramLen] = 0;
63    
64     xVncExtSetParamReply rep;
65     - int n;
66     rep.type = X_Reply;
67     rep.length = 0;
68     rep.success = 0;
69     @@ -514,8 +531,14 @@ static int ProcVncExtSetParam(ClientPtr
70    
71     deny:
72     if (client->swapped) {
73     +#if XORG < 112
74     + int n;
75     swaps(&rep.sequenceNumber, n);
76     swapl(&rep.length, n);
77     +#else
78     + swaps(&rep.sequenceNumber);
79     + swapl(&rep.length);
80     +#endif
81     }
82     WriteToClient(client, sizeof(xVncExtSetParamReply), (char *)&rep);
83     return (client->noClientException);
84     @@ -523,9 +546,13 @@ deny:
85    
86     static int SProcVncExtSetParam(ClientPtr client)
87     {
88     - register char n;
89     REQUEST(xVncExtSetParamReq);
90     +#if XORG < 112
91     + register char n;
92     swaps(&stuff->length, n);
93     +#else
94     + swaps(&stuff->length);
95     +#endif
96     REQUEST_AT_LEAST_SIZE(xVncExtSetParamReq);
97     return ProcVncExtSetParam(client);
98     }
99     @@ -539,7 +566,6 @@ static int ProcVncExtGetParam(ClientPtr
100     param.buf[stuff->paramLen] = 0;
101    
102     xVncExtGetParamReply rep;
103     - int n;
104     rep.type = X_Reply;
105     rep.sequenceNumber = client->sequence;
106     rep.success = 0;
107     @@ -557,9 +583,16 @@ static int ProcVncExtGetParam(ClientPtr
108     rep.length = (len + 3) >> 2;
109     rep.valueLen = len;
110     if (client->swapped) {
111     +#if XORG < 112
112     + int n;
113     swaps(&rep.sequenceNumber, n);
114     swapl(&rep.length, n);
115     swaps(&rep.valueLen, n);
116     +#else
117     + swaps(&rep.sequenceNumber);
118     + swapl(&rep.length);
119     + swaps(&rep.valueLen);
120     +#endif
121     }
122     WriteToClient(client, sizeof(xVncExtGetParamReply), (char *)&rep);
123     if (value)
124     @@ -570,9 +603,13 @@ static int ProcVncExtGetParam(ClientPtr
125    
126     static int SProcVncExtGetParam(ClientPtr client)
127     {
128     - register char n;
129     REQUEST(xVncExtGetParamReq);
130     +#if XORG < 112
131     + register char n;
132     swaps(&stuff->length, n);
133     +#else
134     + swaps(&stuff->length);
135     +#endif
136     REQUEST_AT_LEAST_SIZE(xVncExtGetParamReq);
137     return ProcVncExtGetParam(client);
138     }
139     @@ -586,7 +623,6 @@ static int ProcVncExtGetParamDesc(Client
140     param.buf[stuff->paramLen] = 0;
141    
142     xVncExtGetParamDescReply rep;
143     - int n;
144     rep.type = X_Reply;
145     rep.sequenceNumber = client->sequence;
146     rep.success = 0;
147     @@ -601,9 +637,16 @@ static int ProcVncExtGetParamDesc(Client
148     rep.length = (len + 3) >> 2;
149     rep.descLen = len;
150     if (client->swapped) {
151     +#if XORG < 112
152     + int n;
153     swaps(&rep.sequenceNumber, n);
154     swapl(&rep.length, n);
155     swaps(&rep.descLen, n);
156     +#else
157     + swaps(&rep.sequenceNumber);
158     + swapl(&rep.length);
159     + swaps(&rep.descLen);
160     +#endif
161     }
162     WriteToClient(client, sizeof(xVncExtGetParamDescReply), (char *)&rep);
163     if (desc)
164     @@ -613,9 +656,13 @@ static int ProcVncExtGetParamDesc(Client
165    
166     static int SProcVncExtGetParamDesc(ClientPtr client)
167     {
168     - register char n;
169     REQUEST(xVncExtGetParamDescReq);
170     +#if XORG < 112
171     + register char n;
172     swaps(&stuff->length, n);
173     +#else
174     + swaps(&stuff->length);
175     +#endif
176     REQUEST_AT_LEAST_SIZE(xVncExtGetParamDescReq);
177     return ProcVncExtGetParamDesc(client);
178     }
179     @@ -626,7 +673,6 @@ static int ProcVncExtListParams(ClientPt
180     REQUEST_SIZE_MATCH(xVncExtListParamsReq);
181    
182     xVncExtListParamsReply rep;
183     - int n;
184     rep.type = X_Reply;
185     rep.sequenceNumber = client->sequence;
186    
187     @@ -642,9 +688,16 @@ static int ProcVncExtListParams(ClientPt
188     rep.length = (len + 3) >> 2;
189     rep.nParams = nParams;
190     if (client->swapped) {
191     +#if XORG < 112
192     + int n;
193     swaps(&rep.sequenceNumber, n);
194     swapl(&rep.length, n);
195     swaps(&rep.nParams, n);
196     +#else
197     + swaps(&rep.sequenceNumber);
198     + swapl(&rep.length);
199     + swaps(&rep.nParams);
200     +#endif
201     }
202     WriteToClient(client, sizeof(xVncExtListParamsReply), (char *)&rep);
203     rdr::U8* data = new rdr::U8[len];
204     @@ -664,9 +717,13 @@ static int ProcVncExtListParams(ClientPt
205    
206     static int SProcVncExtListParams(ClientPtr client)
207     {
208     - register char n;
209     REQUEST(xVncExtListParamsReq);
210     +#if XORG < 112
211     + register char n;
212     swaps(&stuff->length, n);
213     +#else
214     + swaps(&stuff->length);
215     +#endif
216     REQUEST_SIZE_MATCH(xVncExtListParamsReq);
217     return ProcVncExtListParams(client);
218     }
219     @@ -689,11 +746,19 @@ static int ProcVncExtSetServerCutText(Cl
220    
221     static int SProcVncExtSetServerCutText(ClientPtr client)
222     {
223     - register char n;
224     REQUEST(xVncExtSetServerCutTextReq);
225     +#if XORG < 112
226     + register char n;
227     swaps(&stuff->length, n);
228     +#else
229     + swaps(&stuff->length);
230     +#endif
231     REQUEST_AT_LEAST_SIZE(xVncExtSetServerCutTextReq);
232     +#if XORG < 112
233     swapl(&stuff->textLen, n);
234     +#else
235     + swapl(&stuff->textLen);
236     +#endif
237     return ProcVncExtSetServerCutText(client);
238     }
239    
240     @@ -703,15 +768,21 @@ static int ProcVncExtGetClientCutText(Cl
241     REQUEST_SIZE_MATCH(xVncExtGetClientCutTextReq);
242    
243     xVncExtGetClientCutTextReply rep;
244     - int n;
245     rep.type = X_Reply;
246     rep.length = (clientCutTextLen + 3) >> 2;
247     rep.sequenceNumber = client->sequence;
248     rep.textLen = clientCutTextLen;
249     if (client->swapped) {
250     +#if XORG < 112
251     + int n;
252     swaps(&rep.sequenceNumber, n);
253     swapl(&rep.length, n);
254     swapl(&rep.textLen, n);
255     +#else
256     + swaps(&rep.sequenceNumber);
257     + swapl(&rep.length);
258     + swapl(&rep.textLen);
259     +#endif
260     }
261     WriteToClient(client, sizeof(xVncExtGetClientCutTextReply), (char *)&rep);
262     if (clientCutText)
263     @@ -721,9 +792,13 @@ static int ProcVncExtGetClientCutText(Cl
264    
265     static int SProcVncExtGetClientCutText(ClientPtr client)
266     {
267     - register char n;
268     REQUEST(xVncExtGetClientCutTextReq);
269     +#if XORG < 112
270     + register char n;
271     swaps(&stuff->length, n);
272     +#else
273     + swaps(&stuff->length);
274     +#endif
275     REQUEST_SIZE_MATCH(xVncExtGetClientCutTextReq);
276     return ProcVncExtGetClientCutText(client);
277     }
278     @@ -753,12 +828,21 @@ static int ProcVncExtSelectInput(ClientP
279    
280     static int SProcVncExtSelectInput(ClientPtr client)
281     {
282     - register char n;
283     REQUEST(xVncExtSelectInputReq);
284     +#if XORG < 112
285     + register char n;
286     swaps(&stuff->length, n);
287     +#else
288     + swaps(&stuff->length);
289     +#endif
290     REQUEST_SIZE_MATCH(xVncExtSelectInputReq);
291     +#if XORG < 112
292     swapl(&stuff->window, n);
293     swapl(&stuff->mask, n);
294     +#else
295     + swapl(&stuff->window);
296     + swapl(&stuff->mask);
297     +#endif
298     return ProcVncExtSelectInput(client);
299     }
300    
301     @@ -804,9 +888,14 @@ static int ProcVncExtConnect(ClientPtr c
302     rep.length = 0;
303     rep.sequenceNumber = client->sequence;
304     if (client->swapped) {
305     +#if XORG < 112
306     int n;
307     swaps(&rep.sequenceNumber, n);
308     swapl(&rep.length, n);
309     +#else
310     + swaps(&rep.sequenceNumber);
311     + swapl(&rep.length);
312     +#endif
313     }
314     WriteToClient(client, sizeof(xVncExtConnectReply), (char *)&rep);
315     return (client->noClientException);
316     @@ -814,9 +903,13 @@ static int ProcVncExtConnect(ClientPtr c
317    
318     static int SProcVncExtConnect(ClientPtr client)
319     {
320     - register char n;
321     REQUEST(xVncExtConnectReq);
322     +#if XORG < 112
323     + register char n;
324     swaps(&stuff->length, n);
325     +#else
326     + swaps(&stuff->length);
327     +#endif
328     REQUEST_AT_LEAST_SIZE(xVncExtConnectReq);
329     return ProcVncExtConnect(client);
330     }
331     @@ -836,7 +929,6 @@ static int ProcVncExtGetQueryConnect(Cli
332     qcTimeout = 0;
333    
334     xVncExtGetQueryConnectReply rep;
335     - int n;
336     rep.type = X_Reply;
337     rep.sequenceNumber = client->sequence;
338     rep.timeout = qcTimeout;
339     @@ -845,11 +937,20 @@ static int ProcVncExtGetQueryConnect(Cli
340     rep.opaqueId = (CARD32)(long)queryConnectId;
341     rep.length = (rep.userLen + rep.addrLen + 3) >> 2;
342     if (client->swapped) {
343     +#if XORG < 112
344     + int n;
345     swaps(&rep.sequenceNumber, n);
346     swapl(&rep.userLen, n);
347     swapl(&rep.addrLen, n);
348     swapl(&rep.timeout, n);
349     swapl(&rep.opaqueId, n);
350     +#else
351     + swaps(&rep.sequenceNumber);
352     + swapl(&rep.userLen);
353     + swapl(&rep.addrLen);
354     + swapl(&rep.timeout);
355     + swapl(&rep.opaqueId);
356     +#endif
357     }
358     WriteToClient(client, sizeof(xVncExtGetQueryConnectReply), (char *)&rep);
359     if (qcTimeout)
360     @@ -861,9 +962,13 @@ static int ProcVncExtGetQueryConnect(Cli
361    
362     static int SProcVncExtGetQueryConnect(ClientPtr client)
363     {
364     - register char n;
365     REQUEST(xVncExtGetQueryConnectReq);
366     +#if XORG < 112
367     + register char n;
368     swaps(&stuff->length, n);
369     +#else
370     + swaps(&stuff->length);
371     +#endif
372     REQUEST_SIZE_MATCH(xVncExtGetQueryConnectReq);
373     return ProcVncExtGetQueryConnect(client);
374     }
375     @@ -888,10 +993,15 @@ static int ProcVncExtApproveConnect(Clie
376    
377     static int SProcVncExtApproveConnect(ClientPtr client)
378     {
379     - register char n;
380     REQUEST(xVncExtApproveConnectReq);
381     +#if XORG < 112
382     + register char n;
383     swaps(&stuff->length, n);
384     swapl(&stuff->opaqueId, n);
385     +#else
386     + swaps(&stuff->length);
387     + swapl(&stuff->opaqueId);
388     +#endif
389     REQUEST_SIZE_MATCH(xVncExtApproveConnectReq);
390     return ProcVncExtApproveConnect(client);
391     }
392     diff -up xserver/hw/vnc/xf86vncModule.cc.xorg112 xserver/hw/vnc/xf86vncModule.cc
393     --- xserver/hw/vnc/xf86vncModule.cc.xorg112 2011-08-09 23:16:36.000000000 +0200
394     +++ xserver/hw/vnc/xf86vncModule.cc 2012-03-27 12:54:56.938271322 +0200
395     @@ -26,6 +26,8 @@
396     #include <rfb/Logger_stdio.h>
397     #include <rfb/LogWriter.h>
398    
399     +#include "xorg-version.h"
400     +
401     extern "C" {
402     #define class c_class
403     #define private c_private
404     @@ -89,7 +91,12 @@ static void vncExtensionInitWithParams(I
405     ScrnInfoPtr pScrn = xf86Screens[scr];
406    
407     for (ParameterIterator i(Configuration::global()); i.param; i.next()) {
408     - char* val = xf86FindOptionValue(pScrn->options, i.param->getName());
409     + const char *val;
410     +#if XORG < 112
411     + val = xf86FindOptionValue(pScrn->options, i.param->getName());
412     +#else
413     + val = xf86FindOptionValue((XF86OptionPtr)pScrn->options, i.param->getName());
414     +#endif
415     if (val)
416     i.param->setParam(val);
417     }
418     diff -up xserver/hw/vnc/xorg-version.h.xorg112 xserver/hw/vnc/xorg-version.h
419     --- xserver/hw/vnc/xorg-version.h.xorg112 2012-03-27 12:55:27.576240843 +0200
420     +++ xserver/hw/vnc/xorg-version.h 2012-03-27 12:56:07.541204026 +0200
421     @@ -38,6 +38,8 @@
422     #define XORG 110
423     #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (11 * 100000) + (99 * 1000))
424     #define XORG 111
425     +#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (12 * 100000) + (99 * 1000))
426     +#define XORG 112
427     #else
428     #error "X.Org newer than 1.10 is not supported"
429     #endif