On Mar 20, 2014, at 3:38 PM, Johan Engelen wrote:
Hello David, in libuemf/uemf_utf.c, there is
/** \cond */ /* iconv() has a funny cast on some older systems, on most recent ones it is just char **. This tries to work around the issue. If you build this on another funky system this code may need to be modified, or define ICONV_CAST on the compile line(but it may be tricky). */ #ifdef SOL8 #define ICONV_CAST (const char **) #endif //SOL8 #if !defined(ICONV_CAST) #define ICONV_CAST (char **) #endif //ICONV_CAST /** \endcond */
An example of the macro usage: ... status = iconv(conv, ICONV_CAST &src, &srclen, &dst, &dstlen);
The more "big picture" solution is to just get rid of uemf_utf.c altogether. I'm not sure of all the usage there, but whichever of those reimplemented functions are actually used elsewhere in the folder can just be replaced with use of glib or Glibmm.
The raw C based routines:
https://developer.gnome.org/glib/2.37/glib-Unicode-Manipulation.html
C++ wrapped Glibmm routines (preferred):
https://developer.gnome.org/glibmm/2.37/group__CharsetConv.html ... std::string Glib::convert ( const std::string & str, const std::string & to_codeset, const std::string & from_codeset )
So a rough idea would be to delete uemf_utf.c and uemf_utc.h and replace the conversion use in other files with the standard Glibmm calls.