source file of the GNU LilyPond music typesetter
- (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
class Bla {
Csmob *ptr;
- ~Bla () { scm_unprotect_object (ptr->self_scm_); }
+ ~Bla () { scm_gc_unprotect_object (ptr->self_scm_); }
};
friend class Non_existant_class ; \
SCM smobbed_self () const; \
private:\
- static long smob_tag_; \
+ static scm_t_bits smob_tag_; \
static SCM mark_smob (SCM); \
- static scm_sizet free_smob (SCM s); \
+ static size_t free_smob (SCM s); \
static int print_smob (SCM s, SCM p, scm_print_state*); \
public: \
static SCM equal_p (SCM a, SCM b);\
- static CL * unsmob (SCM);\
+ static CL * unsmob (SCM s){\
+ if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_) \
+ return (CL*) SCM_CELL_WORD_1 (s); \
+ else \
+ return 0; \
+} \
static SCM smob_p (SCM);\
static void init_smobs (); \
private:
SCM self_scm () const { return self_scm_; } \
private:
+#define DECLARE_UNSMOB(CL,name) \
+inline CL * \
+unsmob_ ## name (SCM s) \
+{ \
+return CL::unsmob (s); \
+}
+
+
#endif /* SMOBS_HH */