Skip to content

Commit

Permalink
Define PERL_ARGS_ASSERT_CROAK_XS_USAGE when setting croak_xs_usage
Browse files Browse the repository at this point in the history
This is matching what's done in ExtUtils::ParseXS::Utilities
and avoids to redefine croak_xs_usage later.

References: Dual-Life#194
  • Loading branch information
atoomic committed Aug 10, 2020
1 parent 0118f1c commit f58892b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions parts/inc/mess
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,16 @@ mess_sv(pTHX_ SV *basemsg, bool consume)

#ifndef croak_xs_usage
#if { NEED croak_xs_usage }

#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)

void
croak_xs_usage(const CV *const cv, const char *const params)
{
dTHX;
const GV *const gv = CvGV(cv);

#ifdef PERL_ARGS_ASSERT_CROAK_XS_USAGE
PERL_ARGS_ASSERT_CROAK_XS_USAGE;
#else
assert(cv); assert(params);
#endif

if (gv) {
const char *const gvname = GvNAME(gv);
Expand All @@ -230,6 +227,7 @@ croak_xs_usage(const CV *const cv, const char *const params)
}
#endif
#endif
#endif

=xsinit

Expand Down

0 comments on commit f58892b

Please sign in to comment.