From 041c1a236adc7fba9323bf915d40b86b247edf2a Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 6 Sep 2020 13:10:02 -0600 Subject: [PATCH] Use macro instead of its expansion We already have a macro that expands to what this code does; it's clearer to use it. --- gv.h | 2 +- handy.h | 2 +- op.h | 2 +- regexp.h | 2 +- sv.h | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gv.h b/gv.h index f598586..36d7745 100644 --- a/gv.h +++ b/gv.h @@ -26,7 +26,7 @@ struct gp { #define GvXPVGV(gv) ((XPVGV*)SvANY(gv)) -#if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__INTEL_COMPILER) +#if defined (DEBUGGING) && defined(PERL_USE_GCC_BRACE_GROUPS) && !defined(__INTEL_COMPILER) # define GvGP(gv) \ (0+(*({GV *const _gvgp = (GV *) (gv); \ assert(SvTYPE(_gvgp) == SVt_PVGV || SvTYPE(_gvgp) == SVt_PVLV); \ diff --git a/handy.h b/handy.h index 37d0468..1637f46 100644 --- a/handy.h +++ b/handy.h @@ -93,7 +93,7 @@ already-built-in ones return pointers to what their names indicate. =cut */ -#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) +#if defined(PERL_USE_GCC_BRACE_GROUPS) # define MUTABLE_PTR(p) ({ void *p_ = (p); p_; }) #else # define MUTABLE_PTR(p) ((void *) (p)) diff --git a/op.h b/op.h index 12d3595..e286f8b 100644 --- a/op.h +++ b/op.h @@ -396,7 +396,7 @@ struct pmop { #else # define PmopSTASH(o) \ (((o)->op_pmflags & PMf_ONCE) ? (o)->op_pmstashstartu.op_pmstash : NULL) -# if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) +# if defined (DEBUGGING) && defined(PERL_USE_GCC_BRACE_GROUPS) # define PmopSTASH_set(o,hv) ({ \ assert((o)->op_pmflags & PMf_ONCE); \ ((o)->op_pmstashstartu.op_pmstash = (hv)); \ diff --git a/regexp.h b/regexp.h index 16fddce..5335061 100644 --- a/regexp.h +++ b/regexp.h @@ -608,7 +608,7 @@ and check for NULL. the start pos (so s/.\G// would fail on second iteration */ -#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) +#if defined(PERL_USE_GCC_BRACE_GROUPS) # define ReREFCNT_inc(re) \ ({ \ /* This is here to generate a casting warning if incorrect. */ \ diff --git a/sv.h b/sv.h index aae04cd..19ce718 100644 --- a/sv.h +++ b/sv.h @@ -1147,7 +1147,7 @@ object type. Exposed to perl code via Internals::SvREADONLY(). #endif -#if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) +#if defined (DEBUGGING) && defined(PERL_USE_GCC_BRACE_GROUPS) # define SvTAIL(sv) ({ const SV *const _svtail = (const SV *)(sv); \ assert(SvTYPE(_svtail) != SVt_PVAV); \ assert(SvTYPE(_svtail) != SVt_PVHV); \ @@ -1199,7 +1199,7 @@ object type. Exposed to perl code via Internals::SvREADONLY(). # endif # define SvEND(sv) ((sv)->sv_u.svu_pv + ((XPV*)SvANY(sv))->xpv_cur) -# if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) +# if defined (DEBUGGING) && defined(PERL_USE_GCC_BRACE_GROUPS) /* These get expanded inside other macros that already use a variable _sv */ # define SvPVX(sv) \ (*({ SV *const _svpvx = MUTABLE_SV(sv); \ @@ -1414,7 +1414,7 @@ object type. Exposed to perl code via Internals::SvREADONLY(). # define BmFLAGS(sv) (SvTAIL(sv) ? FBMcf_TAIL : 0) #endif -#if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) +#if defined (DEBUGGING) && defined(PERL_USE_GCC_BRACE_GROUPS) # define BmUSEFUL(sv) \ (*({ SV *const _bmuseful = MUTABLE_SV(sv); \ assert(SvTYPE(_bmuseful) >= SVt_PVIV); \ @@ -1873,7 +1873,7 @@ Like C but doesn't process magic. ? TRUE \ : (fallback)) -#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) +#if defined(PERL_USE_GCC_BRACE_GROUPS) # define SvIVx(sv) ({SV *_sv = MUTABLE_SV(sv); SvIV(_sv); }) # define SvUVx(sv) ({SV *_sv = MUTABLE_SV(sv); SvUV(_sv); }) -- 1.8.3.1