Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions XSUB.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ Variable which is setup by C<xsubpp> to designate the object in a C++
XSUB. This is always the proper type for the C++ object. See C<L</CLASS>> and
L<perlxs/"Using XS With C++">.

=for apidoc Amn|SSize_t|ax
=for apidoc Amn|Stack_off_t|ax
Variable which is setup by C<xsubpp> to indicate the stack base offset,
used by the C<ST>, C<XSprePUSH> and C<XSRETURN> macros. The C<dMARK> macro
must be called prior to setup the C<MARK> variable.

=for apidoc Amn|SSize_t|items
=for apidoc Amn|Stack_off_t|items
Variable which is setup by C<xsubpp> to indicate the number of
items on the stack. See L<perlxs/"Variable-length Parameter Lists">.

Expand Down Expand Up @@ -157,13 +157,13 @@ is a lexical C<$_> in scope.
* Try explicitly using XS_INTERNAL/XS_EXTERNAL instead, please. */
#define XS(name) XS_EXTERNAL(name)

#define dAX const SSize_t ax = (SSize_t)(MARK - PL_stack_base + 1)
#define dAX const Stack_off_t ax = (Stack_off_t)(MARK - PL_stack_base + 1)

#define dAXMARK \
SSize_t ax = POPMARK; \
Stack_off_t ax = POPMARK; \
SV **mark = PL_stack_base + ax++

#define dITEMS SSize_t items = (SSize_t)(SP - MARK)
#define dITEMS Stack_off_t items = (Stack_off_t)(SP - MARK)

#define dXSARGS \
dSP; dAXMARK; dITEMS
Expand All @@ -174,16 +174,16 @@ is a lexical C<$_> in scope.
Note these macros are not drop in replacements for dXSARGS since they set
PL_xsubfilename. */
#define dXSBOOTARGSXSAPIVERCHK \
SSize_t ax = XS_BOTHVERSION_SETXSUBFN_POPMARK_BOOTCHECK; \
Stack_off_t ax = XS_BOTHVERSION_SETXSUBFN_POPMARK_BOOTCHECK; \
SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
#define dXSBOOTARGSAPIVERCHK \
SSize_t ax = XS_APIVERSION_SETXSUBFN_POPMARK_BOOTCHECK; \
Stack_off_t ax = XS_APIVERSION_SETXSUBFN_POPMARK_BOOTCHECK; \
SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
/* dXSBOOTARGSNOVERCHK has no API in xsubpp to choose it so do
#undef dXSBOOTARGSXSAPIVERCHK
#define dXSBOOTARGSXSAPIVERCHK dXSBOOTARGSNOVERCHK */
#define dXSBOOTARGSNOVERCHK \
SSize_t ax = XS_SETXSUBFN_POPMARK; \
Stack_off_t ax = XS_SETXSUBFN_POPMARK; \
SV **mark = PL_stack_base + ax - 1; dSP; dITEMS

#define dXSTARG SV * const targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
Expand Down
3 changes: 2 additions & 1 deletion embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -3786,7 +3786,8 @@ Adp |void |wrap_op_checker|Optype opcode \
p |void |write_to_stderr|NN SV *msv
Xp |void |xs_boot_epilog |const SSize_t ax

FTXopv |SSize_t|xs_handshake |const U32 key \
FTXopv |Stack_off_t|xs_handshake \
|const U32 key \
|NN void *v_my_perl \
|NN const char *file \
|...
Expand Down
2 changes: 1 addition & 1 deletion proto.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5531,12 +5531,12 @@ Perl_my_cxt_init(pTHX_ int *indexp, size_t size)
'file' is the source filename of the caller.
*/

SSize_t
Stack_off_t
Perl_xs_handshake(const U32 key, void * v_my_perl, const char * file, ...)
{
va_list args;
SSize_t items;
SSize_t ax;
Stack_off_t items;
Stack_off_t ax;
void * got;
void * need;
const char *stage = "first";
Expand Down Expand Up @@ -5598,12 +5598,12 @@ Perl_xs_handshake(const U32 key, void * v_my_perl, const char * file, ...)
ax = POPMARK;
{ SV **mark = PL_stack_base + ax++;
{ dSP;
items = (SSize_t)(SP - MARK);
items = (Stack_off_t)(SP - MARK);
}
}
} else {
items = va_arg(args, SSize_t);
ax = va_arg(args, SSize_t);
items = va_arg(args, Stack_off_t);
ax = va_arg(args, Stack_off_t);
}
assert(ax >= 0);
assert(items >= 0);
Expand Down