#include "smobs.hh"
#include <typeinfo>
+template <class Super>
+SCM
+Smob_base<Super>::mark_trampoline (SCM arg)
+{
+ return (Super::unsmob (arg))->mark_smob ();
+}
+
template <class Super>
SCM
Smob_base<Super>::register_ptr (Super *p)
return s;
}
+// Default, should not actually get called
+template <class Super>
+SCM
+Smob_base<Super>::mark_smob ()
+{
+ return SCM_UNSPECIFIED;
+}
+
template <class Super>
int
Smob_base<Super>::print_smob (SCM, SCM p, scm_print_state *)
if (Super::free_smob != 0)
scm_set_smob_free (smob_tag_, Super::free_smob);
- if (Super::mark_smob != 0)
- scm_set_smob_mark (smob_tag_, Super::mark_smob);
+ if (&Super::mark_smob != &Smob_base<Super>::mark_smob)
+ scm_set_smob_mark (smob_tag_, Super::mark_trampoline);
if (Super::print_smob != 0)
scm_set_smob_print (smob_tag_, Super::print_smob);
if (Super::equal_p != 0)