--- JSON-XS/XS.xs 2013/10/28 23:23:10 1.120 +++ JSON-XS/XS.xs 2013/10/29 15:55:49 1.122 @@ -19,6 +19,17 @@ # define UTF8_MAXBYTES 13 #endif +// compatibility with perl <5.18 +#ifndef HvNAMELEN_get +# define HvNAMELEN_get(hv) strlen (HvNAME (hv)) +#endif +#ifndef HvNAMELEN +# define HvNAMELEN(hv) HvNAMELEN_get (hv) +#endif +#ifndef HvNAMEUTF8 +# define HvNAMEUTF8(hv) 0 +#endif + // three extra for rounding, sign, and end of string #define IVUV_MAXCHARS (sizeof (UV) * CHAR_BIT * 28 / 93 + 3) @@ -1494,6 +1505,8 @@ ++dec->cur; + decode_ws (dec); + tag = decode_sv (dec); if (!tag) goto fail; @@ -1501,11 +1514,15 @@ if (!SvPOK (tag)) ERR ("malformed JSON string, (tag) must be a string"); + decode_ws (dec); + if (*dec->cur != ')') ERR (") expected after tag"); ++dec->cur; + decode_ws (dec); + val = decode_sv (dec); if (!val) goto fail;