warnings.h - length guard cop_warnings bitvector checks

This commit is contained in:
Yves Orton 2022-11-01 15:03:41 +01:00
parent 39cf776065
commit f0774ef1d0
3 changed files with 16 additions and 6 deletions

2
lib/warnings.pm generated
View File

@ -5,7 +5,7 @@
package warnings;
our $VERSION = "1.59";
our $VERSION = "1.60";
# Verify that we're called correctly so that warnings will work.
# Can't use Carp, since Carp uses us!

View File

@ -16,7 +16,7 @@
#
# This script is normally invoked from regen.pl.
$VERSION = '1.59';
$VERSION = '1.60';
BEGIN {
require './regen/regen_lib.pl';
@ -569,8 +569,13 @@ sub warnings_h_boilerplate_2 { return <<'EOM'; }
#define isLEXWARN_off \
cBOOL(!PL_curcop || PL_curcop->cop_warnings == pWARN_STD)
#define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE))
#define isWARN_on(c,x) (PerlWarnIsSet_((U8 *)(c + 1), 2*(x)))
#define isWARNf_on(c,x) (PerlWarnIsSet_((U8 *)(c + 1), 2*(x)+1))
#define hasWARNBIT(c,x) ((c)[0] > (2*(x)/8))
#define isWARN_on(c,x) (hasWARNBIT(c,x) \
? PerlWarnIsSet_((U8 *)((c) + 1), 2*(x)) \
: 0)
#define isWARNf_on(c,x) (hasWARNBIT(c,x) \
? PerlWarnIsSet_((U8 *)((c) + 1), 2*(x)+1) \
: 0)
#define DUP_WARNINGS(p) Perl_dup_warnings(aTHX_ p)

9
warnings.h generated
View File

@ -141,8 +141,13 @@
#define isLEXWARN_off \
cBOOL(!PL_curcop || PL_curcop->cop_warnings == pWARN_STD)
#define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE))
#define isWARN_on(c,x) (PerlWarnIsSet_((U8 *)(c + 1), 2*(x)))
#define isWARNf_on(c,x) (PerlWarnIsSet_((U8 *)(c + 1), 2*(x)+1))
#define hasWARNBIT(c,x) ((c)[0] > (2*(x)/8))
#define isWARN_on(c,x) (hasWARNBIT(c,x) \
? PerlWarnIsSet_((U8 *)((c) + 1), 2*(x)) \
: 0)
#define isWARNf_on(c,x) (hasWARNBIT(c,x) \
? PerlWarnIsSet_((U8 *)((c) + 1), 2*(x)+1) \
: 0)
#define DUP_WARNINGS(p) Perl_dup_warnings(aTHX_ p)