I've been building ImageMagick 7.0.9-3 on Itanium HP-UX 11.31 with HP's ANSI C/C++ compiler.
HP-UX's C library doesn't have strcasestr(), so config/config.h contains:
/* #undef HAVE_STRCASESTR */
However, a check for HAVE_STRCASESTR is never made in the code, so calls to strcasestr() fail
in MagickCore/profile.c, MagickCore/color.c and coders/ps.c.
There is an implementation of strcasestr() shipped with ImageMagick in MagickCore/nt-base.h, but as
the name implies, this is only fully included for the Windows platform.
I fixed it in HP-UX by copying that strcasestr() function from MagickCore/nt-base.h to MagickCore/string_.h
so that the code looked like this in MagickCore/string_.h:
extern size_t strlen(const char *s);
extern int toupper(int c);
static inline char *strcasestr(const char *haystack,const char *needle)
#endif /* HAVE_STRCASESTR */
It's probably not the "most correct" way of doing things (also note I had to add the two extern statements to keep the HP compiler happy), but it worked for me.
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.
2 posts • Page 1 of 1