Subject: | compilation failure |
Hi Dan,
The compilation of Encode.xs ends in failure using the compilers not supporting
C99, such as MSVC++. This is because the violation of a rule that declarations must
precede statements.
So, may I ask you a favour? Could you apply the attached patch?
Best regards,
Taro Nishino
Subject: | Encode.xs.diff.txt |
--- Encode.xs.orig Sun Sep 6 20:57:06 2009
+++ Encode.xs Sun Sep 6 21:22:08 2009
@@ -405,19 +405,23 @@
SV * obj
SV * src
int check
+PREINIT:
+ STRLEN slen;
+ U8 *s;
+ U8 *e;
+ SV *dst;
+ bool renewed = 0;
CODE:
{
+ dSP; ENTER; SAVETMPS;
if (src == &PL_sv_undef) src = newSV(0);
- STRLEN slen;
- U8 *s = (U8 *) SvPV(src, slen);
- U8 *e = (U8 *) SvEND(src);
- SV *dst = newSV(slen>0?slen:1); /* newSV() abhors 0 -- inaba */
+ s = (U8 *) SvPV(src, slen);
+ e = (U8 *) SvEND(src);
+ dst = newSV(slen>0?slen:1); /* newSV() abhors 0 -- inaba */
/*
* PerlIO check -- we assume the object is of PerlIO if renewed
*/
- bool renewed = 0;
- dSP; ENTER; SAVETMPS;
PUSHMARK(sp);
XPUSHs(obj);
PUTBACK;
@@ -464,13 +468,18 @@
SV * obj
SV * src
int check
+PREINIT:
+ STRLEN slen;
+ U8 *s;
+ U8 *e;
+ SV *dst;
+ bool renewed = 0;
CODE:
{
if (src == &PL_sv_undef) src = newSV(0);
- STRLEN slen;
- U8 *s = (U8 *) SvPV(src, slen);
- U8 *e = (U8 *) SvEND(src);
- SV *dst = newSV(slen>0?slen:1); /* newSV() abhors 0 -- inaba */
+ s = (U8 *) SvPV(src, slen);
+ e = (U8 *) SvEND(src);
+ dst = newSV(slen>0?slen:1); /* newSV() abhors 0 -- inaba */
if (SvUTF8(src)) {
/* Already encoded */
if (strict_utf8(aTHX_ obj)) {