summaryrefslogtreecommitdiff
path: root/warnings.h
diff options
context:
space:
mode:
Diffstat (limited to 'warnings.h')
-rw-r--r--warnings.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/warnings.h b/warnings.h
index 7ef3c0495c..aa830c05fe 100644
--- a/warnings.h
+++ b/warnings.h
@@ -18,8 +18,8 @@
#define G_WARN_ALL_MASK (G_WARN_ALL_ON|G_WARN_ALL_OFF)
#define pWARN_STD NULL
-#define pWARN_ALL (((SV*)0)+1) /* use warnings 'all' */
-#define pWARN_NONE (((SV*)0)+2) /* no warnings 'all' */
+#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)
@@ -85,8 +85,12 @@
#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) ? (p) \
+ : 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))