From a13d7d434041d3767028d67cc5922fca553bfe5b Mon Sep 17 00:00:00 2001 From: pkeir Date: Sun, 24 Apr 2022 16:37:37 +0100 Subject: [PATCH] Added support for (CMake) Unity Builds. (#94) --- src/pcre2_compile.c | 4 ++++ src/pcre2_convert.c | 2 +- src/pcre2_dfa_match.c | 10 +++++++--- src/pcre2_jit_compile.c | 4 ++-- src/pcre2_match.c | 4 ++++ 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c index de259c9..48d7b97 100644 --- a/src/pcre2_compile.c +++ b/src/pcre2_compile.c @@ -10620,4 +10620,8 @@ re = NULL; goto EXIT; } +#undef NLBLOCK /* Block containing newline information */ +#undef PSSTART /* Field containing processed string start */ +#undef PSEND /* Field containing processed string end */ + /* End of pcre2_compile.c */ diff --git a/src/pcre2_convert.c b/src/pcre2_convert.c index d45b6fe..f127389 100644 --- a/src/pcre2_convert.c +++ b/src/pcre2_convert.c @@ -67,7 +67,7 @@ POSSIBILITY OF SUCH DAMAGE. /* States for range and POSIX processing */ -enum { RANGE_NOT_STARTED, RANGE_STARTING, RANGE_STARTED }; +enum { RANGE_NOT_STARTED, RANGE_STARTING, RANGE_ACTIVE }; enum { POSIX_START_REGEX, POSIX_ANCHORED, POSIX_NOT_BRACKET, POSIX_CLASS_NOT_STARTED, POSIX_CLASS_STARTING, POSIX_CLASS_STARTED }; diff --git a/src/pcre2_dfa_match.c b/src/pcre2_dfa_match.c index d29130f..9563e1f 100644 --- a/src/pcre2_dfa_match.c +++ b/src/pcre2_dfa_match.c @@ -350,7 +350,7 @@ Returns: the return from the callout */ static int -do_callout(PCRE2_SPTR code, PCRE2_SIZE *offsets, PCRE2_SPTR current_subject, +do_callout_dfa(PCRE2_SPTR code, PCRE2_SIZE *offsets, PCRE2_SPTR current_subject, PCRE2_SPTR ptr, dfa_match_block *mb, PCRE2_SIZE extracode, PCRE2_SIZE *lengthptr) { @@ -2799,7 +2799,7 @@ for (;;) || code[LINK_SIZE + 1] == OP_CALLOUT_STR) { PCRE2_SIZE callout_length; - rrc = do_callout(code, offsets, current_subject, ptr, mb, + rrc = do_callout_dfa(code, offsets, current_subject, ptr, mb, 1 + LINK_SIZE, &callout_length); if (rrc < 0) return rrc; /* Abandon */ if (rrc > 0) break; /* Fail this thread */ @@ -3196,7 +3196,7 @@ for (;;) case OP_CALLOUT_STR: { PCRE2_SIZE callout_length; - rrc = do_callout(code, offsets, current_subject, ptr, mb, 0, + rrc = do_callout_dfa(code, offsets, current_subject, ptr, mb, 0, &callout_length); if (rrc < 0) return rrc; /* Abandon */ if (rrc == 0) @@ -4057,4 +4057,8 @@ while (rws->next != NULL) return rc; } +#undef NLBLOCK /* Block containing newline information */ +#undef PSSTART /* Field containing processed string start */ +#undef PSEND /* Field containing processed string end */ + /* End of pcre2_dfa_match.c */ diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c index 32dec66..b6b1313 100644 --- a/src/pcre2_jit_compile.c +++ b/src/pcre2_jit_compile.c @@ -9689,7 +9689,7 @@ BACKTRACK_AS(recurse_backtrack)->matchingpath = LABEL(); return cc + 1 + LINK_SIZE; } -static sljit_s32 SLJIT_FUNC do_callout(struct jit_arguments *arguments, pcre2_callout_block *callout_block, PCRE2_SPTR *jit_ovector) +static sljit_s32 SLJIT_FUNC do_callout_jit(struct jit_arguments *arguments, pcre2_callout_block *callout_block, PCRE2_SPTR *jit_ovector) { PCRE2_SPTR begin; PCRE2_SIZE *ovector; @@ -9806,7 +9806,7 @@ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, STR_PTR, 0); /* SLJIT_R0 = arguments */ OP1(SLJIT_MOV, SLJIT_R1, 0, STACK_TOP, 0); GET_LOCAL_BASE(SLJIT_R2, 0, OVECTOR_START); -sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS3(32, W, W, W), SLJIT_IMM, SLJIT_FUNC_ADDR(do_callout)); +sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS3(32, W, W, W), SLJIT_IMM, SLJIT_FUNC_ADDR(do_callout_jit)); OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0); free_stack(common, callout_arg_size); diff --git a/src/pcre2_match.c b/src/pcre2_match.c index 6354e1b..814e274 100644 --- a/src/pcre2_match.c +++ b/src/pcre2_match.c @@ -7533,4 +7533,8 @@ else match_data->rc = PCRE2_ERROR_NOMATCH; return match_data->rc; } +#undef NLBLOCK /* Block containing newline information */ +#undef PSSTART /* Field containing processed string start */ +#undef PSEND /* Field containing processed string end */ + /* End of pcre2_match.c */