pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/imlib2 Use my_lround() on Interix too.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/33fe764c24e7
branches:  trunk
changeset: 502456:33fe764c24e7
user:      tv <tv%pkgsrc.org@localhost>
date:      Fri Nov 04 20:11:47 2005 +0000

description:
Use my_lround() on Interix too.

Add minimalist #ifndef blocks to rip out XShm support on Interix.

diffstat:

 graphics/imlib2/distinfo         |   7 ++-
 graphics/imlib2/patches/patch-ab |   4 +-
 graphics/imlib2/patches/patch-ac |  71 ++++++++++++++++++++++++++++++++++++++++
 graphics/imlib2/patches/patch-ad |  35 +++++++++++++++++++
 graphics/imlib2/patches/patch-ae |  45 +++++++++++++++++++++++++
 5 files changed, 158 insertions(+), 4 deletions(-)

diffs (200 lines):

diff -r dc6aa318223a -r 33fe764c24e7 graphics/imlib2/distinfo
--- a/graphics/imlib2/distinfo  Fri Nov 04 20:06:14 2005 +0000
+++ b/graphics/imlib2/distinfo  Fri Nov 04 20:11:47 2005 +0000
@@ -1,10 +1,13 @@
-$NetBSD: distinfo,v 1.14 2005/11/02 00:45:02 hiramatsu Exp $
+$NetBSD: distinfo,v 1.15 2005/11/04 20:11:47 tv Exp $
 
 SHA1 (imlib2-1.2.0.tar.gz) = 54f8ef83b0eac3f8e7f2218705e02a425fa73118
 RMD160 (imlib2-1.2.0.tar.gz) = 158ed1bd7c59b8d1db2c00db98027d9c5c0abec3
 Size (imlib2-1.2.0.tar.gz) = 890457 bytes
 SHA1 (patch-aa) = 73e23778f6aaee5de213865aa64f9c5a4af6ba24
-SHA1 (patch-ab) = 93b6cee1242ac971926df4418699a68d999e5482
+SHA1 (patch-ab) = 191ab0083b410ef9892fbf6f4c4aede0e15dc9e2
+SHA1 (patch-ac) = da65ecd50753c37e267c2fd3de7f1dcef8dab1f1
+SHA1 (patch-ad) = adf301fe0179aa1ab05fc54bb7ab706ee97ab7a7
+SHA1 (patch-ae) = 6503e4cbc9bbb93f971ab2ae9fd7d50ddee9e0e8
 SHA1 (patch-ba) = 0a3937fc4d017356ba5d33f957426f9befc94730
 SHA1 (patch-bb) = 9df1e76c3023c6f9714906b226293bc3e026baca
 SHA1 (patch-bc) = 29365da268d210b4eb7bb431f815a78bcf22f1e3
diff -r dc6aa318223a -r 33fe764c24e7 graphics/imlib2/patches/patch-ab
--- a/graphics/imlib2/patches/patch-ab  Fri Nov 04 20:06:14 2005 +0000
+++ b/graphics/imlib2/patches/patch-ab  Fri Nov 04 20:11:47 2005 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-ab,v 1.9 2005/11/02 00:45:02 hiramatsu Exp $
+$NetBSD: patch-ab,v 1.10 2005/11/04 20:11:47 tv Exp $
 
 This patch makes imlib2 compile on systems that don't have an lround
 function, which is defined in C99.
@@ -14,7 +14,7 @@
 +#include <sys/param.h>
 +#endif
 +
-+#if defined(__NetBSD__) || defined(__OpenBSD__) || \
++#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__INTERIX) || \
 +    (defined(__DragonFly__) && __DragonFly_version <= 130002)
 +#define lround(x) my_lround(x)
 +static long my_lround(double x)
diff -r dc6aa318223a -r 33fe764c24e7 graphics/imlib2/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/imlib2/patches/patch-ac  Fri Nov 04 20:11:47 2005 +0000
@@ -0,0 +1,71 @@
+$NetBSD: patch-ac,v 1.4 2005/11/04 20:11:47 tv Exp $
+
+--- src/lib/grab.c.orig        2004-11-01 04:39:42.000000000 -0500
++++ src/lib/grab.c
+@@ -412,7 +412,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];
+@@ -545,14 +547,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;
+@@ -599,12 +604,14 @@ __imlib_GrabDrawableToRGBA(DATA32 * data
+                }
+           }
+      }
++#endif /* !__INTERIX */
+    if (!is_shm)
+       xim = XGetImage(d, p, x, y, w, h, 0xffffffff, ZPixmap);
+ 
+    if ((m) && (domask))
+      {
+         _x_err = 0;
++#ifndef __INTERIX
+         if (x_does_shm)
+           {
+              mxim = XShmCreateImage(d, v, 1, ZPixmap, NULL, &mshminfo, w, h);
+@@ -652,6 +659,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data
+                     }
+                }
+           }
++#endif /* !__INTERIX */
+         if (!is_mshm)
+            mxim = XGetImage(d, m, 0, 0, w, h, 0xffffffff, ZPixmap);
+      }
+@@ -705,6 +713,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);
+@@ -718,6 +727,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data
+         shmdt(mshminfo.shmaddr);
+         shmctl(mshminfo.shmid, IPC_RMID, 0);
+      }
++#endif /* !__INTERIX */
+    XDestroyImage(xim);
+    if (created_mask)
+       XFreePixmap(d, m);
diff -r dc6aa318223a -r 33fe764c24e7 graphics/imlib2/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/imlib2/patches/patch-ad  Fri Nov 04 20:11:47 2005 +0000
@@ -0,0 +1,35 @@
+$NetBSD: patch-ad,v 1.4 2005/11/04 20:11:47 tv Exp $
+
+--- src/lib/rend.c.orig        2004-11-01 04:39:42.000000000 -0500
++++ src/lib/rend.c
+@@ -495,24 +495,30 @@ __imlib_RenderImage(Display * d, ImlibIm
+              gcm = XCreateGC(d, m, GCGraphicsExposures, &gcv);
+           }
+         /* write the mask */
++#ifndef __INTERIX
+         if (shm)
+            /* write shm XImage */
+            XShmPutImage(d, m, gcm, mxim, 0, 0, dx, dy, dw, dh, False);
+         /* write regular XImage */
+         else
++#endif /* !__INTERIX */
+            XPutImage(d, m, gcm, mxim, 0, 0, dx, dy, dw, dh);
+      }
+    /* write the image */
++#ifndef __INTERIX
+    if (shm)
+       /* write shm XImage */
+       XShmPutImage(d, w, gc, xim, 0, 0, dx, dy, dw, dh, False);
+    /* write regular XImage */
+    else
++#endif /* !__INTERIX */
+       XPutImage(d, w, gc, xim, 0, 0, dx, dy, dw, dh);
+    /* free the XImage and put onto our free list */
+    /* wait for the write to be done */
++#ifndef __INTERIX
+    if (shm)
+       XSync(d, False);
++#endif /* !__INTERIX */
+    __imlib_ConsumeXImage(d, xim);
+    if (m)
+       __imlib_ConsumeXImage(d, mxim);
diff -r dc6aa318223a -r 33fe764c24e7 graphics/imlib2/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/imlib2/patches/patch-ae  Fri Nov 04 20:11:47 2005 +0000
@@ -0,0 +1,45 @@
+$NetBSD: patch-ae,v 1.4 2005/11/04 20:11:47 tv Exp $
+
+--- src/lib/ximage.c.orig      2004-11-01 04:39:42.000000000 -0500
++++ src/lib/ximage.c
+@@ -81,8 +81,10 @@ __imlib_FlushXImage(Display * d)
+ 
+                   xim = list_xim[i];
+                   list_mem_use -= xim->bytes_per_line * xim->height;
++#ifndef __INTERIX
+                   if (list_si[i])
+                      XShmDetach(d, list_si[i]);
++#endif /* !__INTERIX */
+                   XDestroyImage(xim);
+                   if (list_si[i])
+                     {
+@@ -163,11 +165,13 @@ __imlib_ProduceXImage(Display * d, Visua
+    /* if we havent check the shm extension before - see if its there */
+    if (x_does_shm < 0)
+      {
++#ifndef __INTERIX
+         /* if its there set dose_xhm flag */
+         if (XShmQueryExtension(d))
+            x_does_shm = 1;
+         /* clear the flag - no shm at all */
+         else
++#endif
+            x_does_shm = 0;
+      }
+    /* find a cached XImage (to avoid server to & fro) that is big enough */
+@@ -219,6 +223,7 @@ __imlib_ProduceXImage(Display * d, Visua
+ 
+    /* work on making a shared image */
+    xim = NULL;
++#ifndef __INTERIX
+    /* if the server does shm */
+    if (x_does_shm)
+      {
+@@ -301,6 +306,7 @@ __imlib_ProduceXImage(Display * d, Visua
+                }
+           }
+      }
++#endif /* !__INTERIX */
+    /* ok if xim == NULL it all failed - fall back to XImages */
+    if (!xim)
+      {



Home | Main Index | Thread Index | Old Index