Getting revision number in preprocessor statement - figured

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Getting revision number in preprocessor statement - figured

Post by mkoppanen »

I would like add MagickClutImage support to Imagick. It seems like it is implemented in 6.3.5-7. How do I check for the revision in preprocessor statement?

The only place I found the revision is MagickLibVersionNumber and I see no way to use that in a preprocessor statement.

#if REVISION > 6

#endif

is my goal.
Mikko Koppanen
My blog: http://valokuva.org
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: Getting revision number in preprocessor statement - figured

Post by mkoppanen »

This is maybe like the tenth time I edit this post. Finally after banging my head to the wall I got it right (had some help along the way):

#define IMAGICK_RETRIEVE_REVISION(a,b,c,d) d
#define IMAGICK_CHECK_MAGICKLIB_REVISION(a) IMAGICK_RETRIEVE_REVISION(a)

IMAGICK_CHECK_MAGICKLIB_REVISION(MagickLibVersionNumber) > 6

Seems to be working just fine.
Mikko Koppanen
My blog: http://valokuva.org
Post Reply