summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-05-21 13:35:43 +0000
committerNicholas Clark <nick@ccl4.org>2008-05-21 13:35:43 +0000
commitafa74d4282044c64ab152392003f47bb0674abd2 (patch)
treedae202bcf5f0624235f7d7446c5eef9e30288694 /proto.h
parent79706302bf1cd487fc44c6b9085b2f2ba0fa11ff (diff)
downloadperl-afa74d4282044c64ab152392003f47bb0674abd2.tar.gz
Add Perl_croak_xs_usage(), which reduces a lot of explicit calls of
the form Perl_croak(aTHX_ "Usage %s::%s(%s)", "ouch" "awk", "eee_yow"); down to croak_xs_usage(cv, "eee_yow"); and refactor all the core XS code to use it. This adds () to the error messages for attributes::* p4raw-id: //depot/perl@33901
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index e40cdcfaeb..da79be1516 100644
--- a/proto.h
+++ b/proto.h
@@ -327,6 +327,14 @@ PERL_CALLCONV void Perl_croak(pTHX_ const char* pat, ...)
PERL_CALLCONV void Perl_vcroak(pTHX_ const char* pat, va_list* args)
__attribute__noreturn__;
+PERL_CALLCONV void Perl_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
+ __attribute__noreturn__
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_CROAK_XS_USAGE \
+ assert(cv); assert(params)
+
+
#if defined(PERL_IMPLICIT_CONTEXT)
PERL_CALLCONV void Perl_croak_nocontext(const char* pat, ...)
__attribute__noreturn__