NatronGitHub / openfx-arena

Extra OpenFX plugins for Natron
Other
41 stars 11 forks source link

imagemagick isnan preventing compilation #16

Closed mj-saunders closed 3 years ago

mj-saunders commented 3 years ago

This: https://github.com/ImageMagick/ImageMagick/issues/3690 led to this: https://github.com/ImageMagick/ImageMagick/commit/c322ab10641c1a89e16924cce259828232e079c which appears to break compilation with the following error:

In file included from /usr/include/ImageMagick-7/MagickCore/MagickCore.h:78,
                 from /usr/include/ImageMagick-7/Magick++/Include.h:45,
                 from /usr/include/ImageMagick-7/Magick++.h:10,
                 from ../Magick/ReadPSD.cpp:22:
../OpenFX/Support/include/ofxsCore.h:193:26: error: expected unqualified-id before ‘double’
  193 |   inline bool IsNaN     (double x) { return (std::isnan)(x);    }
      |                          ^~~~~~
/usr/include/ImageMagick-7/MagickCore/magick-type.h:192:22: note: in definition of macro ‘IsNaN’
  192 | #  define IsNaN(a) ((a) != (a))
      |                      ^
../OpenFX/Support/include/ofxsCore.h:193:26: error: expected ‘)’ before ‘double’
  193 |   inline bool IsNaN     (double x) { return (std::isnan)(x);    }
      |                          ^~~~~~
/usr/include/ImageMagick-7/MagickCore/magick-type.h:192:22: note: in definition of macro ‘IsNaN’
  192 | #  define IsNaN(a) ((a) != (a))
      |                      ^
/usr/include/ImageMagick-7/MagickCore/magick-type.h:192:21: note: to match this ‘(’
  192 | #  define IsNaN(a) ((a) != (a))
      |                     ^
../OpenFX/Support/include/ofxsCore.h:193:15: note: in expansion of macro ‘IsNaN’
  193 |   inline bool IsNaN     (double x) { return (std::isnan)(x);    }
      |               ^~~~~
../OpenFX/Support/include/ofxsCore.h:193:26: error: expected ‘)’ before ‘double’
  193 |   inline bool IsNaN     (double x) { return (std::isnan)(x);    }
      |                          ^~~~~~
/usr/include/ImageMagick-7/MagickCore/magick-type.h:192:22: note: in definition of macro ‘IsNaN’
  192 | #  define IsNaN(a) ((a) != (a))
      |                      ^
/usr/include/ImageMagick-7/MagickCore/magick-type.h:192:20: note: to match this ‘(’
  192 | #  define IsNaN(a) ((a) != (a))
      |                    ^
../OpenFX/Support/include/ofxsCore.h:193:15: note: in expansion of macro ‘IsNaN’
  193 |   inline bool IsNaN     (double x) { return (std::isnan)(x);    }
      |               ^~~~~
rodlie commented 3 years ago

This is a ImageMagick issue

mj-saunders commented 3 years ago

Thanks @rodlie, I honestly wasn't sure. You're saying then, that the "fix" in the imagemagick source was not the right approach?

rodlie commented 3 years ago

Will take a look a bit later today (we use ImageMagick v6).

mj-saunders commented 3 years ago

Appreciated. No stress, just thought I should make this known somewhere.

rodlie commented 3 years ago

So, this change https://github.com/ImageMagick/ImageMagick/commit/c322ab10641c1a89e16924cce259828232e079c breaks everything. IsNaN is now define IsNaN(a) ((a) != (a)).

devernay commented 3 years ago

@rodlie quick fix, add:

#ifdef IsNan
#undef IsNan
#endif

before #include "ofxsCore.h"

devernay commented 3 years ago

ah that's what you did.

mj-saunders commented 3 years ago

cheers