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
|
$NetBSD: patch-ac,v 1.6 2011/01/31 10:22:26 wiz Exp $
Use my_lround() on Interix too.
Add minimalist #ifndef blocks to rip out XShm support on Interix.
--- src/lib/grab.c.orig 2007-02-16 12:58:53.000000000 +0100
+++ src/lib/grab.c
@@ -539,7 +539,9 @@ __imlib_GrabDrawableToRGBA(DATA32 * data
int i;
int src_x, src_y, src_w, src_h, origw, origh;
int width, height, clipx, clipy;
+#ifndef __INTERIX
XShmSegmentInfo shminfo, mshminfo;
+#endif /* !__INTERIX */
XImage *xim = NULL, *mxim = NULL;
static signed char x_does_shm = -1;
XColor cols[256];
@@ -673,14 +675,17 @@ __imlib_GrabDrawableToRGBA(DATA32 * data
/* Create an Ximage (shared or not) */
if (x_does_shm < 0)
{
+#ifndef __INTERIX
if (XShmQueryExtension(d))
x_does_shm = 1;
else
+#endif /* !__INTERIX */
x_does_shm = 0;
}
prev_erh = XSetErrorHandler((XErrorHandler) Tmp_HandleXError);
+#ifndef __INTERIX
if (x_does_shm)
{
_x_err = 0;
@@ -727,6 +732,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data
}
}
}
+#endif /* !__INTERIX */
if (!is_shm)
xim = XGetImage(d, p, x, y, w, h, 0xffffffff, ZPixmap);
if (!xim)
@@ -739,6 +745,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data
if ((m) && (domask))
{
_x_err = 0;
+#ifndef __INTERIX
if (x_does_shm)
{
mxim = XShmCreateImage(d, v, 1, ZPixmap, NULL, &mshminfo, w, h);
@@ -786,6 +793,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data
}
}
}
+#endif /* !__INTERIX */
if (!is_mshm)
mxim = XGetImage(d, m, 0, 0, w, h, 0xffffffff, ZPixmap);
}
@@ -844,6 +852,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data
d, xim, mxim, v, xatt.depth, x, y, w, h, 0);
/* destroy the Ximage */
+#ifndef __INTERIX
if (is_shm)
{
XSync(d, False);
@@ -857,6 +866,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data
shmdt(mshminfo.shmaddr);
shmctl(mshminfo.shmid, IPC_RMID, 0);
}
+#endif /* !__INTERIX */
XDestroyImage(xim);
if (created_mask)
XFreePixmap(d, m);
|