#ifdef PERL_DONT_CREATE_GVSV
Ap |GV* |gv_SVadd |NN GV* gv
#endif
+po |bool |ckwarn |U32 w
+po |bool |ckwarn_d |U32 w
p |void |offer_nice_chunk |NN void *chunk|U32 chunk_size
#define gv_SVadd(a) Perl_gv_SVadd(aTHX_ a)
#endif
#ifdef PERL_CORE
+#endif
+#ifdef PERL_CORE
#define offer_nice_chunk(a,b) Perl_offer_nice_chunk(aTHX_ a,b)
#endif
#define ck_anoncode(a) Perl_ck_anoncode(aTHX_ a)
=item PAD_SET_CUR
Set the current pad to be pad C<n> in the padlist, saving
-the previous current pad.
+the previous current pad. NB currently this macro expands to a string too
+long for some compilers, so it's best to replace it with
+
+ SAVECOMPPAD();
+ PAD_SET_CUR_NOSAVE(padlist,n);
+
void PAD_SET_CUR (PADLIST padlist, I32 n)
__attribute__nonnull__(pTHX_1);
#endif
+PERL_CALLCONV bool Perl_ckwarn(pTHX_ U32 w);
+PERL_CALLCONV bool Perl_ckwarn_d(pTHX_ U32 w);
PERL_CALLCONV void Perl_offer_nice_chunk(pTHX_ void *chunk, U32 chunk_size)
__attribute__nonnull__(pTHX_1);
}
}
+/* implements the ckWARN? macros */
+
+bool
+Perl_ckwarn(pTHX_ U32 w)
+{
+ return
+ (
+ isLEXWARN_on
+ && PL_curcop->cop_warnings != pWARN_NONE
+ && (
+ PL_curcop->cop_warnings == pWARN_ALL
+ || isWARN_on(PL_curcop->cop_warnings, unpackWARN1(w))
+ || (unpackWARN2(w) &&
+ isWARN_on(PL_curcop->cop_warnings, unpackWARN2(w)))
+ || (unpackWARN3(w) &&
+ isWARN_on(PL_curcop->cop_warnings, unpackWARN3(w)))
+ || (unpackWARN4(w) &&
+ isWARN_on(PL_curcop->cop_warnings, unpackWARN4(w)))
+ )
+ )
+ ||
+ (
+ isLEXWARN_off && PL_dowarn & G_WARN_ON
+ )
+ ;
+}
+
+/* implements the ckWARN?_d macro */
+
+bool
+Perl_ckwarn_d(pTHX_ U32 w)
+{
+ return
+ isLEXWARN_off
+ || PL_curcop->cop_warnings == pWARN_ALL
+ || (
+ PL_curcop->cop_warnings != pWARN_NONE
+ && (
+ isWARN_on(PL_curcop->cop_warnings, unpackWARN1(w))
+ || (unpackWARN2(w) &&
+ isWARN_on(PL_curcop->cop_warnings, unpackWARN2(w)))
+ || (unpackWARN3(w) &&
+ isWARN_on(PL_curcop->cop_warnings, unpackWARN3(w)))
+ || (unpackWARN4(w) &&
+ isWARN_on(PL_curcop->cop_warnings, unpackWARN4(w)))
+ )
+ )
+ ;
+}
+
+
+
/* since we've already done strlen() for both nam and val
* we can use that info to make things faster than
* sprintf(s, "%s=%s", nam, val)
#define isWARN_on(c,x) (IsSet(SvPVX_const(c), 2*(x)))
#define isWARNf_on(c,x) (IsSet(SvPVX_const(c), 2*(x)+1))
-#define ckWARN(x) \
- ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \
- (PL_curcop->cop_warnings == pWARN_ALL || \
- isWARN_on(PL_curcop->cop_warnings, x) ) ) \
- || (isLEXWARN_off && PL_dowarn & G_WARN_ON) )
-
-#define ckWARN2(x,y) \
- ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \
- (PL_curcop->cop_warnings == pWARN_ALL || \
- isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) ) ) \
- || (isLEXWARN_off && PL_dowarn & G_WARN_ON) )
-
-#define ckWARN3(x,y,z) \
- ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \
- (PL_curcop->cop_warnings == pWARN_ALL || \
- isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) || \
- isWARN_on(PL_curcop->cop_warnings, z) ) ) \
- || (isLEXWARN_off && PL_dowarn & G_WARN_ON) )
-
-#define ckWARN4(x,y,z,t) \
- ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \
- (PL_curcop->cop_warnings == pWARN_ALL || \
- isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) || \
- isWARN_on(PL_curcop->cop_warnings, z) || \
- isWARN_on(PL_curcop->cop_warnings, t) ) ) \
- || (isLEXWARN_off && PL_dowarn & G_WARN_ON) )
-
-#define ckWARN_d(x) \
- (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \
- (PL_curcop->cop_warnings != pWARN_NONE && \
- isWARN_on(PL_curcop->cop_warnings, x) ) )
-
-#define ckWARN2_d(x,y) \
- (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \
- (PL_curcop->cop_warnings != pWARN_NONE && \
- (isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) ) ) )
-
-#define ckWARN3_d(x,y,z) \
- (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \
- (PL_curcop->cop_warnings != pWARN_NONE && \
- (isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) || \
- isWARN_on(PL_curcop->cop_warnings, z) ) ) )
-
-#define ckWARN4_d(x,y,z,t) \
- (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \
- (PL_curcop->cop_warnings != pWARN_NONE && \
- (isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) || \
- isWARN_on(PL_curcop->cop_warnings, z) || \
- isWARN_on(PL_curcop->cop_warnings, t) ) ) )
+#define ckWARN(w) Perl_ckwarn(aTHX_ packWARN(w))
+#define ckWARN2(w1,w2) Perl_ckwarn(aTHX_ packWARN2(w1,w2))
+#define ckWARN3(w1,w2,w3) Perl_ckwarn(aTHX_ packWARN3(w1,w2,w3))
+#define ckWARN4(w1,w2,w3,w4) Perl_ckwarn(aTHX_ packWARN4(w1,w2,w3,w4))
+
+#define ckWARN_d(w) Perl_ckwarn_d(aTHX_ packWARN(w))
+#define ckWARN2_d(w1,w2) Perl_ckwarn_d(aTHX_ packWARN2(w1,w2))
+#define ckWARN3_d(w1,w2,w3) Perl_ckwarn_d(aTHX_ packWARN3(w1,w2,w3))
+#define ckWARN4_d(w1,w2,w3,w4) Perl_ckwarn_d(aTHX_ packWARN4(w1,w2,w3,w4))
#define packWARN(a) (a )
#define packWARN2(a,b) ((a) | ((b)<<8) )
#define isWARN_on(c,x) (IsSet(SvPVX_const(c), 2*(x)))
#define isWARNf_on(c,x) (IsSet(SvPVX_const(c), 2*(x)+1))
-#define ckWARN(x) \
- ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \
- (PL_curcop->cop_warnings == pWARN_ALL || \
- isWARN_on(PL_curcop->cop_warnings, x) ) ) \
- || (isLEXWARN_off && PL_dowarn & G_WARN_ON) )
-
-#define ckWARN2(x,y) \
- ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \
- (PL_curcop->cop_warnings == pWARN_ALL || \
- isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) ) ) \
- || (isLEXWARN_off && PL_dowarn & G_WARN_ON) )
-
-#define ckWARN3(x,y,z) \
- ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \
- (PL_curcop->cop_warnings == pWARN_ALL || \
- isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) || \
- isWARN_on(PL_curcop->cop_warnings, z) ) ) \
- || (isLEXWARN_off && PL_dowarn & G_WARN_ON) )
-
-#define ckWARN4(x,y,z,t) \
- ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \
- (PL_curcop->cop_warnings == pWARN_ALL || \
- isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) || \
- isWARN_on(PL_curcop->cop_warnings, z) || \
- isWARN_on(PL_curcop->cop_warnings, t) ) ) \
- || (isLEXWARN_off && PL_dowarn & G_WARN_ON) )
-
-#define ckWARN_d(x) \
- (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \
- (PL_curcop->cop_warnings != pWARN_NONE && \
- isWARN_on(PL_curcop->cop_warnings, x) ) )
-
-#define ckWARN2_d(x,y) \
- (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \
- (PL_curcop->cop_warnings != pWARN_NONE && \
- (isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) ) ) )
-
-#define ckWARN3_d(x,y,z) \
- (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \
- (PL_curcop->cop_warnings != pWARN_NONE && \
- (isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) || \
- isWARN_on(PL_curcop->cop_warnings, z) ) ) )
-
-#define ckWARN4_d(x,y,z,t) \
- (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \
- (PL_curcop->cop_warnings != pWARN_NONE && \
- (isWARN_on(PL_curcop->cop_warnings, x) || \
- isWARN_on(PL_curcop->cop_warnings, y) || \
- isWARN_on(PL_curcop->cop_warnings, z) || \
- isWARN_on(PL_curcop->cop_warnings, t) ) ) )
+#define ckWARN(w) Perl_ckwarn(aTHX_ packWARN(w))
+#define ckWARN2(w1,w2) Perl_ckwarn(aTHX_ packWARN2(w1,w2))
+#define ckWARN3(w1,w2,w3) Perl_ckwarn(aTHX_ packWARN3(w1,w2,w3))
+#define ckWARN4(w1,w2,w3,w4) Perl_ckwarn(aTHX_ packWARN4(w1,w2,w3,w4))
+
+#define ckWARN_d(w) Perl_ckwarn_d(aTHX_ packWARN(w))
+#define ckWARN2_d(w1,w2) Perl_ckwarn_d(aTHX_ packWARN2(w1,w2))
+#define ckWARN3_d(w1,w2,w3) Perl_ckwarn_d(aTHX_ packWARN3(w1,w2,w3))
+#define ckWARN4_d(w1,w2,w3,w4) Perl_ckwarn_d(aTHX_ packWARN4(w1,w2,w3,w4))
#define packWARN(a) (a )
#define packWARN2(a,b) ((a) | ((b)<<8) )