IM 6.8.7-5, MSVC 12, nearbyint conflict

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
tc33
Posts: 40
Joined: 2012-10-21T22:10:21-07:00
Authentication code: 67789

IM 6.8.7-5, MSVC 12, nearbyint conflict

Post by tc33 »

Hi,

Just got VS 2013 / MSVC 12. I attempted to build ImageMagick 6.8.7-5 in debug/64 bit. I received syntax errors relating to 'nearbyint' in math.h, which is possibly a new function in the MSVC std lib impl, since I was able to compile IM without error on MSVC 11.

It turns out the function #define nearbyint(x) ((ssize_t) ((x)+0.5)) in magick-baseconfig.h (~line 206) conflicts with the one defined in math.h. In fact, I don't know what purpose this function serves, since I can't find any references to it anywhere in the IM project. Once I commented this function out within magick-baseconfig.h, IM compiled successfully.

I recommend removing the definition of nearbyint from magick-baseconfig.h, since it no longer seems to serve the purpose it was intended for (or I'm missing something, which is also very possible). Thanks!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM 6.8.7-5, MSVC 12, nearbyint conflict

Post by magick »

Thanks for the problem report. We'll get a patch into the next point release of ImageMagick.
tc33
Posts: 40
Joined: 2012-10-21T22:10:21-07:00
Authentication code: 67789

Re: IM 6.8.7-5, MSVC 12, nearbyint conflict

Post by tc33 »

You rock, thanks!
Post Reply