summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-03-04 19:58:33 -0700
committerKarl Williamson <khw@cpan.org>2020-03-11 09:00:03 -0600
commit619d7873ba993b76544e98af9079c5f8a4b90886 (patch)
tree75989d034d32f9f968dc1f66e841a36a71736243 /regcomp.h
parentda35f4caf751e91609a937f0c03c0efa1c608091 (diff)
downloadperl-619d7873ba993b76544e98af9079c5f8a4b90886.tar.gz
regcomp.h: Combine two macros into one
One of these macros is no longer used, so just combine them.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/regcomp.h b/regcomp.h
index 33dec76252..1766941d75 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -1101,21 +1101,22 @@ re.pm, especially to the documentation.
if (DEBUG_v_TEST || RE_DEBUG_FLAG(RE_DEBUG_EXTRA_DUMP_PRE_OPTIMIZE)) x )
/* initialization */
-/* get_sv() can return NULL during global destruction. */
-#define GET_RE_DEBUG_FLAGS DEBUG_r({ \
- SV * re_debug_flags_sv = NULL; \
- re_debug_flags_sv = PL_curcop ? get_sv(RE_DEBUG_FLAGS, GV_ADD) : NULL; \
- if (re_debug_flags_sv) { \
- if (!SvIOK(re_debug_flags_sv)) \
- sv_setuv(re_debug_flags_sv, RE_DEBUG_COMPILE_DUMP | RE_DEBUG_EXECUTE_MASK ); \
- re_debug_flags=SvIV(re_debug_flags_sv); \
- }\
-})
-
#ifdef DEBUGGING
-#define DECLARE_AND_GET_RE_DEBUG_FLAGS volatile IV re_debug_flags = 0; \
- PERL_UNUSED_VAR(re_debug_flags); GET_RE_DEBUG_FLAGS;
+#define DECLARE_AND_GET_RE_DEBUG_FLAGS \
+ volatile IV re_debug_flags = 0; PERL_UNUSED_VAR(re_debug_flags); \
+ STMT_START { \
+ SV * re_debug_flags_sv = NULL; \
+ /* get_sv() can return NULL during global destruction. */ \
+ re_debug_flags_sv = PL_curcop ? get_sv(RE_DEBUG_FLAGS, GV_ADD) : NULL; \
+ if (re_debug_flags_sv) { \
+ if (!SvIOK(re_debug_flags_sv)) /* If doesnt exist set to default */\
+ sv_setuv(re_debug_flags_sv, \
+ /* These defaults should be kept in sync with re.pm */ \
+ RE_DEBUG_COMPILE_DUMP | RE_DEBUG_EXECUTE_MASK ); \
+ re_debug_flags=SvIV(re_debug_flags_sv); \
+ } \
+ } STMT_END
#define isDEBUG_WILDCARD (DEBUG_v_TEST || RE_DEBUG_FLAG(RE_DEBUG_EXTRA_WILDCARD))