summaryrefslogtreecommitdiff
path: root/scope.h
diff options
context:
space:
mode:
Diffstat (limited to 'scope.h')
-rw-r--r--scope.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/scope.h b/scope.h
index 0b9a483515..cc349f0f7c 100644
--- a/scope.h
+++ b/scope.h
@@ -77,8 +77,17 @@
#define SAVECLEARSV(sv) save_clearsv(SOFT_CAST(SV**)&(sv))
#define SAVEDELETE(h,k,l) \
save_delete(SOFT_CAST(HV*)(h), SOFT_CAST(char*)(k), (I32)(l))
+#ifdef PERL_OBJECT
+#define CALLDESTRUCTOR this->*SSPOPDPTR
#define SAVEDESTRUCTOR(f,p) \
- save_destructor(SOFT_CAST(void(*)_((void*)))(f),SOFT_CAST(void*)(p))
+ save_destructor((DESTRUCTORFUNC)(FUNC_NAME_TO_PTR(f)), \
+ SOFT_CAST(void*)(p))
+#else
+#define CALLDESTRUCTOR *SSPOPDPTR
+#define SAVEDESTRUCTOR(f,p) \
+ save_destructor(SOFT_CAST(void(*)_((void*)))(FUNC_NAME_TO_PTR(f)), \
+ SOFT_CAST(void*)(p))
+#endif
#define SAVESTACK_POS() STMT_START { \
SSCHECK(2); \
SSPUSHINT(stack_sp - stack_base); \