diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2008-09-29 17:19:07 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2008-09-29 17:19:07 +0000 |
commit | bfa863c83bfd01d72a748decaaf2676b800c60ff (patch) | |
tree | 02491e683928ba1c318d3ebc1200feb7c8bb78b4 /gnu/usr.bin/perl/warnings.h | |
parent | 37a0443eb842cf3d2c9de0e5647b0094a0dcf0bd (diff) |
import perl 5.10.0 from CPAN
Diffstat (limited to 'gnu/usr.bin/perl/warnings.h')
-rw-r--r-- | gnu/usr.bin/perl/warnings.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gnu/usr.bin/perl/warnings.h b/gnu/usr.bin/perl/warnings.h index 1fbaa422acb..66a9a0a65df 100644 --- a/gnu/usr.bin/perl/warnings.h +++ b/gnu/usr.bin/perl/warnings.h @@ -17,13 +17,16 @@ #define G_WARN_ONCE 8 /* set if 'once' ever enabled */ #define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF) -#define pWARN_STD Nullsv -#define pWARN_ALL (Nullsv+1) /* use warnings 'all' */ -#define pWARN_NONE (Nullsv+2) /* no warnings 'all' */ +#define pWARN_STD NULL +#define pWARN_ALL (((STRLEN*)0)+1) /* use warnings 'all' */ +#define pWARN_NONE (((STRLEN*)0)+2) /* no warnings 'all' */ #define specialWARN(x) ((x) == pWARN_STD || (x) == pWARN_ALL || \ (x) == pWARN_NONE) +/* if PL_warnhook is set to this value, then warnings die */ +#define PERL_WARNHOOK_FATAL (&PL_sv_placeholder) + /* Warnings Categories added in Perl 5.008 */ #define WARN_ALL 0 @@ -72,18 +75,21 @@ #define WARN_UNTIE 43 #define WARN_UTF8 44 #define WARN_VOID 45 -#define WARN_Y2K 46 #define WARNsize 12 #define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125" #define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0" -#define WARN_TAINTstring "\0\0\0\0\0\0\0\0\0\100\0\0" #define isLEXWARN_on (PL_curcop->cop_warnings != pWARN_STD) #define isLEXWARN_off (PL_curcop->cop_warnings == pWARN_STD) #define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE)) -#define isWARN_on(c,x) (IsSet(SvPVX_const(c), 2*(x))) -#define isWARNf_on(c,x) (IsSet(SvPVX_const(c), 2*(x)+1)) +#define isWARN_on(c,x) (IsSet((U8 *)(c + 1), 2*(x))) +#define isWARNf_on(c,x) (IsSet((U8 *)(c + 1), 2*(x)+1)) + +#define DUP_WARNINGS(p) \ + (specialWARN(p) ? (STRLEN*)(p) \ + : (STRLEN*)CopyD(p, PerlMemShared_malloc(sizeof(*p)+*p), sizeof(*p)+*p, \ + char)) #define ckWARN(w) Perl_ckwarn(aTHX_ packWARN(w)) #define ckWARN2(w1,w2) Perl_ckwarn(aTHX_ packWARN2(w1,w2)) |