[XForms] More robust XPM checking patch

Hans J. Johnson hjohnson at mail.psychiatry.uiowa.edu
Tue Mar 30 10:06:12 EST 2004


Hello Xforms Maintainers,

I've applied the patch below for quite some time now to various versions
of xforms.  It has been submitted to the list before, but may have been
overlooked, or silently discredited.

This patch allows me to compile xforms on both SGI-IRIX, and various
versions of Linux.  (the XPM_34g_or_later flag is not set properly on
SGI-IRIX).

Please consider including it in future releases.

Regards,
Hans J. Johnson
hans-johnson at uiowa.edu
-------------- next part --------------
--- pixmap.c.old	Mon Apr  1 16:06:48 2002
+++ pixmap.c	Mon Apr  1 15:52:26 2002
@@ -84,19 +84,21 @@
     if (!xpma || !xpma->colormap)
 	return;
 
-    if (XPM_34g_or_later)
+
+#if (XpmFormat >=3) &&  (XpmVersion >= 4) && ( XpmRevision >= 7)
     {
 	M_warn("XpmCleanUP", "Using 3.4g features");
 	XFreeColors(flx->display, xpma->colormap,
 		    xpma->alloc_pixels, xpma->nalloc_pixels, 0);
     }
-    else
+#else
     {
 	/* somewhat dangerous */
 	M_warn("XpmCleanUP", "Using old xpm libs");
 	XFreeColors(flx->display, xpma->colormap,
 		    xpma->pixels, xpma->npixels, 0);
     }
+#endif
 
     xpma->colormap = 0;
 


More information about the Xforms mailing list