#include "XSUB.h"
#ifndef PERL_VERSION
-#include "patchlevel.h"
-#define PERL_VERSION PATCHLEVEL
+# include <patchlevel.h>
+# ifndef PERL_VERSION
+# include <could_not_find_Perl_patchlevel.h>
+# endif
+# define PERL_VERSION PATCHLEVEL
#endif
#if PERL_VERSION < 5
else if (k < 0x80)
*r++ = (char)k;
else {
- r += sprintf(r, "\\x{%"UVxf"}", k);
+ /* The return value of sprintf() is unportable.
+ * In modern systems it returns (int) the number of characters,
+ * but in older systems it might return (char*) the original
+ * buffer, or it might even be (void). The easiest portable
+ * thing to do is probably use sprintf() in void context and
+ * then strlen(buffer) for the length. The more proper way
+ * would of course be to figure out the prototype of sprintf.
+ * --jhi */
+ sprintf(r, "\\x{%"UVxf"}", k);
+ r += strlen(r);
}
}
*r++ = '"';
i = perl_call_method(SvPVX(freezer), G_EVAL|G_SCALAR);
SPAGAIN;
if (SvTRUE(ERRSV))
- warn("WARNING(Freezer method call failed): %s",
- SvPVX(ERRSV));
+ warn("WARNING(Freezer method call failed): %"SVf"", ERRSV);
else if (i)
val = newSVsv(POPs);
PUTBACK; FREETMPS; LEAVE;
keysv = svp ? *svp : sv_mortalcopy(&PL_sv_undef);
key = SvPV(keysv, keylen);
svp = hv_fetch((HV*)ival, key,
- SvUTF8(keysv) ? -keylen : keylen, 0);
+ SvUTF8(keysv) ? -(I32)keylen : keylen, 0);
hval = svp ? *svp : sv_mortalcopy(&PL_sv_undef);
}
else {