Fix build for threaded perl + additional project idea
This commit is contained in:
parent
13eaeb1d4a
commit
0d19ccdc1b
2 changed files with 4 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ static void fujson_parse_ws(pTHX_ fujson_parse_ctx *ctx) {
|
|||
}
|
||||
}
|
||||
|
||||
static inline int fujson_parse_string_escape(fujson_parse_ctx *ctx, fustr *r) {
|
||||
static inline int fujson_parse_string_escape(pTHX_ fujson_parse_ctx *ctx, fustr *r) {
|
||||
unsigned int n, s;
|
||||
ctx->buf++; /* '\\' */
|
||||
if (UNLIKELY(ctx->buf == ctx->end)) return 1;
|
||||
|
|
@ -62,14 +62,14 @@ static int fujson_parse_string_buf(pTHX_ fujson_parse_ctx *ctx, fustr *r) {
|
|||
unsigned char x;
|
||||
ctx->buf++; /* '"' */
|
||||
while (true) {
|
||||
fustr_reserve(aTHX_ r, 4);
|
||||
fustr_reserve(r, 4);
|
||||
if (UNLIKELY(ctx->buf == ctx->end)) return 1;
|
||||
x = *ctx->buf;
|
||||
if (UNLIKELY(x == '"')) {
|
||||
ctx->buf++;
|
||||
return 0;
|
||||
} else if (UNLIKELY(x == '\\')) {
|
||||
if (fujson_parse_string_escape(ctx, r)) return 1;
|
||||
if (fujson_parse_string_escape(aTHX_ ctx, r)) return 1;
|
||||
} else if (x >= 0x80) {
|
||||
if (UNLIKELY((len = isC9_STRICT_UTF8_CHAR(ctx->buf, ctx->end)) == 0)) return 1;
|
||||
memcpy(r->cur, ctx->buf, len);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue