--- TagLib.xs_orig 2012-08-24 13:42:24 +1000 +++ TagLib.xs 2012-08-26 20:36:17 +1000 @@ -17,17 +17,30 @@ #include "iconv_wrap.h" -#ifdef do_open(a,b,c,d,e,f,g) -#undef do_open(a,b,c,d,e,f,g) +#ifdef do_open +/* #undef do_open(a,b,c,d,e,f,g) */ #undef do_open -#undef do_close(a,b) +/* #undef do_close(a,b) */ #undef do_close #endif + +#ifdef __MINGW32__ +#ifdef read +#undef read +#endif +#ifdef write +#undef write +#endif +#ifdef setbuf +#undef setbuf +#endif +#endif + #include "apeitem.h" #ifndef do_open -#define do_open Perl_do_open +/* #define do_open Perl_do_open */ #define do_open(a,b,c,d,e,f,g) Perl_do_open(aTHX_ a,b,c,d,e,f,g) -#define do_close Perl_do_close +/* #define do_close Perl_do_close */ #define do_close(a,b) Perl_do_close(aTHX_ a,b) #endif For my mingw.org gcc-4.5.2 I needed also to add the following patches but, for my mingw64.sf gcc-4.7.0 and 4.6.3, it was necessary that the following patches NOT be applied. --- include/iconv_wrap.h_orig 2012-08-24 13:34:03 +1000 +++ include/iconv_wrap.h_new 2012-08-26 20:38:07 +1000 @@ -26,7 +26,7 @@ #else size_t iconv_wrap(iconv_t cd, - char **inbuf, + const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) --- xs/tstring.xs_orig 2012-08-25 17:36:48 +1000 +++ xs/tstring.xs_new 2012-08-25 17:52:56 +1000 @@ -18,7 +18,8 @@ enum TagLib::String::Type t; bool is_copy_from_string = TRUE; iconv_t codec; - char *inbuf, *outbuf; + const char *inbuf; + char *outbuf; size_t inlen, outlen, utf8len; char *utf8; char *errmsg; @@ -324,7 +325,8 @@ PREINIT: iconv_t codec; char mb[8]; - char *inbuf, *outbuf; + const char *inbuf; + char *outbuf; size_t inlen, outlen; INIT: outlen = 8; --- xs/stringiterator.xs_orig 2012-08-25 17:53:38 +1000 +++ xs/stringiterator.xs_new 2012-08-25 17:54:52 +1000 @@ -53,7 +53,8 @@ iconv_t codec = iconv_open("UTF8", "WCHAR_T"); if(codec == (iconv_t)(-1)) croak("iconv_open failed"); - char *inbuf, *outbuf; + const char *inbuf; + char *outbuf; char utf8[1024]; size_t inlen, outlen; inlen = sizeof(wchar_t);