From 72ab4b2e2b9f5aa35378ba82ac99b863f7a63d95 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 8 Dec 2009 21:47:47 +0100 Subject: [PATCH] add vtable finalizer and printer setter macros * libguile/struct.h (SCM_VTABLE_INSTANCE_FINALIZER): Use DATA_REF, not SLOT_REF. (SCM_SET_VTABLE_INSTANCE_FINALIZER, SCM_SET_VTABLE_INSTANCE_PRINTER): New accessor macros. --- libguile/struct.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libguile/struct.h b/libguile/struct.h index 4d4b469af..de216af4d 100644 --- a/libguile/struct.h +++ b/libguile/struct.h @@ -110,8 +110,10 @@ typedef void (*scm_t_struct_finalize) (SCM obj); #define SCM_SET_VTABLE_FLAGS(X,F) (SCM_STRUCT_DATA_REF (X, scm_vtable_index_flags) |= (F)) #define SCM_CLEAR_VTABLE_FLAGS(X,F) (SCM_STRUCT_DATA_REF (X, scm_vtable_index_flags) &= (~(F))) #define SCM_VTABLE_FLAG_IS_SET(X,F) (SCM_STRUCT_DATA_REF (X, scm_vtable_index_flags) & (F)) -#define SCM_VTABLE_INSTANCE_FINALIZER(X) ((scm_t_struct_finalize)SCM_STRUCT_SLOT_REF (X, scm_vtable_index_instance_finalize)) +#define SCM_VTABLE_INSTANCE_FINALIZER(X) ((scm_t_struct_finalize)SCM_STRUCT_DATA_REF (X, scm_vtable_index_instance_finalize)) +#define SCM_SET_VTABLE_INSTANCE_FINALIZER(X,P) (SCM_STRUCT_DATA_SET (X, scm_vtable_index_instance_finalize, (scm_t_bits)(P))) #define SCM_VTABLE_INSTANCE_PRINTER(X) (SCM_STRUCT_SLOT_REF (X, scm_vtable_index_instance_printer)) +#define SCM_SET_VTABLE_INSTANCE_PRINTER(X,P) (SCM_STRUCT_SLOT_SET (X, scm_vtable_index_instance_printer, (P))) #define SCM_VTABLE_NAME(X) (SCM_STRUCT_SLOT_REF (X, scm_vtable_index_name)) #define SCM_SET_VTABLE_NAME(X,V) (SCM_STRUCT_SLOT_SET (X, scm_vtable_index_name, V))