applied suggested fix for xhv_array sizing, with portability tweaks
[p5sagit/p5-mst-13.2.git] / XSUB.h
diff --git a/XSUB.h b/XSUB.h
index a1041ad..cd8a732 100644 (file)
--- a/XSUB.h
+++ b/XSUB.h
@@ -11,7 +11,7 @@
 #endif
 
 #define dXSARGS                                \
-       dSP; dMARK;             \
+       dSP; dMARK;                     \
        I32 ax = mark - stack_base + 1; \
        I32 items = sp - mark
 
 
 #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);       \