summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-10-12 16:39:02 +0100
committerNicholas Clark <nick@ccl4.org>2009-10-12 16:39:02 +0100
commit9b38784150c0aca5746105b5f00bfc653322bcd1 (patch)
tree48457d0d7c2cf65438740ec90bf3382203837dba /util.c
parenta2a5de9516c1b256b060768ac6dad252a3aa3be7 (diff)
downloadperl-9b38784150c0aca5746105b5f00bfc653322bcd1.tar.gz
Add Perl_ck_warner_d(), which combines Perl_ckwarn_d() and Perl_warner().
Replace ckWARN_d{,2,3,4}() && Perl_warner() with it, which trades reduced code size for 1 more function call if warnings are not enabled.
Diffstat (limited to 'util.c')
-rw-r--r--util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/util.c b/util.c
index 20185403dc..94820eff33 100644
--- a/util.c
+++ b/util.c
@@ -1529,6 +1529,19 @@ Perl_warner_nocontext(U32 err, const char *pat, ...)
#endif /* PERL_IMPLICIT_CONTEXT */
void
+Perl_ck_warner_d(pTHX_ U32 err, const char* pat, ...)
+{
+ PERL_ARGS_ASSERT_CK_WARNER_D;
+
+ if (Perl_ckwarn_d(aTHX_ err)) {
+ va_list args;
+ va_start(args, pat);
+ vwarner(err, pat, &args);
+ va_end(args);
+ }
+}
+
+void
Perl_ck_warner(pTHX_ U32 err, const char* pat, ...)
{
PERL_ARGS_ASSERT_CK_WARNER;