diff options
author | Larry Wall <lwall@scalpel.netlabs.com> | 1995-11-21 10:01:00 +1200 |
---|---|---|
committer | Larry <lwall@scalpel.netlabs.com> | 1995-11-21 10:01:00 +1200 |
commit | 4633a7c4bad06b471d9310620b7fe8ddd158cccd (patch) | |
tree | 37ebeb26a64f123784fd8fac6243b124767243b0 /XSUB.h | |
parent | 8e07c86ebc651fe92eb7e3b25f801f57cfb8dd6f (diff) | |
download | perl-4633a7c4bad06b471d9310620b7fe8ddd158cccd.tar.gz |
5.002 beta 1
If you're adventurous, have a look at
ftp://ftp.sems.com/pub/outgoing/perl5.0/perl5.002beta1.tar.gz
Many thanks to Andy for doing the integration.
Obviously, if you consult the bugs database, you'll note there are
still plenty of buglets that need fixing, and several enhancements that
I've intended to put in still haven't made it in (Hi, Tim and Ilya).
But I think it'll be pretty stable. And you can start to fiddle around
with prototypes (which are, of course, still totally undocumented).
Packrats, don't worry too much about readvertising this widely.
Nowadays we're on a T1 here, so our bandwidth is okay.
Have the appropriate amount of jollity.
Larry
Diffstat (limited to 'XSUB.h')
-rw-r--r-- | XSUB.h | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -1,4 +1,4 @@ -#define ST(off) stack_base[ax + off] +#define ST(off) stack_base[ax + (off)] #ifdef CAN_PROTOTYPE #define XS(name) void name(CV* cv) @@ -19,16 +19,17 @@ /* Simple macros to put new mortal values onto the stack. */ /* Typically used to return values from XS functions. */ -#define XST_mIV(i,v) ST(i)=sv_2mortal(newSViv(v)); -#define XST_mNV(i,v) ST(i)=sv_2mortal(newSVnv(v)); -#define XST_mPV(i,v) ST(i)=sv_2mortal(newSVpv(v,0)); -#define XST_mNO(i) ST(i)=sv_mortalcopy(&sv_no); -#define XST_mYES(i) ST(i)=sv_mortalcopy(&sv_yes); -#define XST_mUNDEF(i) ST(i)=sv_newmortal(); +#define XST_mIV(i,v) (ST(i) = sv_2mortal(newSViv(v)) ) +#define XST_mNV(i,v) (ST(i) = sv_2mortal(newSVnv(v)) ) +#define XST_mPV(i,v) (ST(i) = sv_2mortal(newSVpv(v,0))) +#define XST_mNO(i) (ST(i) = &sv_no ) +#define XST_mYES(i) (ST(i) = &sv_yes ) +#define XST_mUNDEF(i) (ST(i) = &sv_undef) -#define XSRETURN_IV(v) XST_mIV(0,v); XSRETURN(1) -#define XSRETURN_NV(v) XST_mNV(0,v); XSRETURN(1) -#define XSRETURN_PV(v) XST_mPV(0,v); XSRETURN(1) -#define XSRETURN_NO XST_mNO(0); XSRETURN(1) -#define XSRETURN_YES XST_mYES(0); XSRETURN(1) -#define XSRETURN_UNDEF XST_mUNDEF(0); XSRETURN(1) +#define XSRETURN_IV(v) do { XST_mIV(0,v); XSRETURN(1); } while (0) +#define XSRETURN_NV(v) do { XST_mNV(0,v); XSRETURN(1); } while (0) +#define XSRETURN_PV(v) do { XST_mPV(0,v); XSRETURN(1); } while (0) +#define XSRETURN_NO do { XST_mNO(0); XSRETURN(1); } while (0) +#define XSRETURN_YES do { XST_mYES(0); XSRETURN(1); } while (0) +#define XSRETURN_UNDEF do { XST_mUNDEF(0); XSRETURN(1); } while (0) +#define XSRETURN_EMPTY do { XSRETURN(0); } while (0) |