applied patch, with indentation tweaks
[p5sagit/p5-mst-13.2.git] / XSUB.h
diff --git a/XSUB.h b/XSUB.h
index 6c6c76e..cd8a732 100644 (file)
--- a/XSUB.h
+++ b/XSUB.h
@@ -1,7 +1,11 @@
 #define ST(off) stack_base[ax + (off)]
 
 #ifdef CAN_PROTOTYPE
+#ifdef PERL_OBJECT
+#define XS(name) void name(CV* cv, CPerlObj* pPerl)
+#else
 #define XS(name) void name(CV* cv)
+#endif
 #else
 #define XS(name) void name(cv) CV* cv;
 #endif
 
 #define dXSI32 I32 ix = XSANY.any_i32
 
+#ifdef __cplusplus
+#  define XSINTERFACE_CVT(ret,name) ret (*name)(...)
+#else
+#  define XSINTERFACE_CVT(ret,name) ret (*name)()
+#endif
+#define dXSFUNCTION(ret)               XSINTERFACE_CVT(ret,XSFUNCTION)
+#define XSINTERFACE_FUNC(ret,cv,f)     ((XSINTERFACE_CVT(ret,))(f))
+#define XSINTERFACE_FUNC_SET(cv,f)     \
+               CvXSUBANY(cv).any_dptr = (void (*) _((void*)))(f)
+
 #define XSRETURN(off)                                  \
     STMT_START {                                       \
        stack_sp = stack_base + ax + ((off) - 1);       \
 #else
 # define XS_VERSION_BOOTCHECK
 #endif
+
+#ifdef PERL_OBJECT
+#include "ObjXSub.h"
+#ifndef NO_XSLOCKS
+#ifdef WIN32
+#include "XSLock.h"
+#endif  /* WIN32 */
+#endif  /* NO_XSLOCKS */
+#else
+#ifdef PERL_CAPI
+#include "PerlCAPI.h"
+#endif
+#endif /* PERL_OBJECT */