This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate with Sarathy.
[perl5.git] / XSUB.h
diff --git a/XSUB.h b/XSUB.h
index c43b7f9..509a1d6 100644 (file)
--- a/XSUB.h
+++ b/XSUB.h
@@ -1,6 +1,6 @@
 #define ST(off) PL_stack_base[ax + (off)]
 
-#if defined(CYGWIN32) && defined(USE_DYNAMIC_LOADING)
+#if defined(CYGWIN) && defined(USE_DYNAMIC_LOADING)
 #  define XS(name) __declspec(dllexport) void name(pTHXo_ CV* cv)
 #else
 #  define XS(name) void name(pTHXo_ CV* cv)
@@ -11,6 +11,9 @@
        I32 ax = mark - PL_stack_base + 1;      \
        I32 items = sp - mark
 
+#define dXSTARG SV * targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
+                            ? PAD_SV(PL_op->op_targ) : sv_newmortal())
+
 #define XSANY CvXSUBANY(cv)
 
 #define dXSI32 I32 ix = XSANY.any_i32
 #  define VTBL_amagicelem      &PL_vtbl_amagicelem
 #endif
 
-#ifdef PERL_OBJECT
-
+#if defined(PERL_OBJECT) || defined(PERL_CAPI)
 #  include "perlapi.h"
 #  include "objXSUB.h"
+#endif /* PERL_OBJECT || PERL_CAPI */
 
-#  undef  aTHXo
-#  define aTHXo                        pPerl
-#  undef  aTHXo_
-#  define aTHXo_               aTHXo,
-#  undef  _aTHXo
-#  define _aTHXo               ,aTHXo
-
-#  ifdef WIN32
-#    undef fprintf
-#    define fprintf                    pPerl->fprintf
-#  endif /* WIN32 */
+#if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_NO_GET_CONTEXT) && !defined(PERL_CORE)
+#  undef aTHX
+#  undef aTHX_
+#  define aTHX         PERL_GET_THX
+#  define aTHX_                aTHX,
+#endif
 
+#if defined(PERL_CAPI)
 #  ifndef NO_XSLOCKS
 #    undef closedir
 #    undef opendir
 #    define shutdown           PerlSock_shutdown
 #    define socket             PerlSock_socket
 #    define socketpair         PerlSock_socketpair
-#    ifdef WIN32
-#      include "XSlock.h"
-#    endif
 #  endif  /* NO_XSLOCKS */
-
-#endif /* PERL_OBJECT */
+#endif  /* PERL_CAPI */