Skip to content
Browse files

Feature test for new ParseSizeGeometry signature in IM 6.4.6-9

  • Loading branch information...
1 parent 1cf38e5 commit a31af8c2908481c06be8d4fcfcaa64bc64a766b0 rmagick committed Dec 5, 2008
Showing with 21 additions and 0 deletions.
  1. +19 −0 configure.ac
  2. +2 −0 ext/RMagick/rmagick_config.h.in
View
19 configure.ac
@@ -678,6 +678,25 @@ if test "$rm_have_getmagickpixelpacket" = yes; then
fi
fi
+# IM 6.4.6-9 changed the number of arguments to ParseSizeGeometry
+AC_CACHE_CHECK(if ParseSizeGeometry has 4 arguments, rv_cv_have_new_parsesizegeometry,
+ [AC_TRY_COMPILE(
+[#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include "magick/api.h"],
+ [MagickStatusType okay; Image *image; const char *geometry;
+ RectangleInfo *rectangle; ExceptionInfo *exception;
+ okay = ParseSizeGeometry(image, geometry, rectangle, exception);],
+ rv_cv_have_new_parsesizegeometry='yes',
+ rv_cv_have_new_parsesizegeometry='no')])
+
+if test "$rv_cv_have_new_parsesizegeometry" = yes; then
+ AC_DEFINE(HAVE_NEW_PARSESIZEGEOMETRY)
+fi
+
+
# Where is ****Magick installed?
MAGICKPREFIX=`${MAGICKCONFIG} --prefix`
View
2 ext/RMagick/rmagick_config.h.in
@@ -189,6 +189,8 @@
#undef HAVE_PALETTEBILEVELMATTETYPE
/* Introduced in IM 5.5.4 - Not available in GM */
#undef HAVE_PARSESIZEGEOMETRY
+/* New signature in IM 6.4.6-9 */
+#undef HAVE_NEW_PARSESIZEGEOMETRY
/* Introduced in IM 6.3.1-6 */
#undef HAVE_POLAROIDIMAGE
/* Introduced in IM 6.0.0 */

0 comments on commit a31af8c

Please sign in to comment.
Something went wrong with that request. Please try again.