]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/ly-smobs.icc
patch::: 1.3.57.jcn1
[lilypond.git] / lily / include / ly-smobs.icc
index 48b3120b24eef11dff4a4d6d5c5fc8ccc4433b3e..fe5baaca0cfd41cb8951b7408a4ca0a639933703 100644 (file)
 #ifndef LY_SMOBS_ICC
 #define LY_SMOBS_ICC
 
+#ifndef SCM_PACK
+#define SCM_PACK(x) ((SCM) x)
+#endif
+
 #define IMPLEMENT_UNSMOB(CL, name)             \
 CL *                                           \
 unsmob_ ## name ( SCM s)                       \
@@ -25,8 +29,8 @@ SCM smobify (CL *cl)\
                                                                        \
   SCM_NEWCELL(s);                                                      \
   SCM_SETCAR(s,CL::smob_tag_);                                         \
-  void * me_p = cl;                                                    \
-  SCM_SETCDR(s,me_p);                                                  \
+  SCM me_s = SCM_PACK (cl);                                                    \
+  SCM_SETCDR (s, me_s); \
 return s;\
 }\
 
@@ -53,8 +57,8 @@ CL::unsmobify_self ()                                                  \
   SCM s = self_scm_;                                                    \
   scm_unprotect_object (s);                                             \
                                                                         \
-  SCM_CAR(self_scm_) = SCM_EOL;         \
-  SCM_CDR(self_scm_) = SCM_EOL;                                                 \
+  SCM_SETCAR (self_scm_, SCM_EOL); \
+  SCM_SETCDR (self_scm_, SCM_EOL); \
   self_scm_ = SCM_EOL;                                                  \
 \
   scm_done_malloc ( - sizeof (CL));\
@@ -88,7 +92,7 @@ CL::free_smob (SCM ses)                               \
 \
  /* no need to call scm_unprotect_object, since this call \
     implies that the object is not protected. */ \
-  SCM_CAR(ses) = SCM_EOL;\
+  SCM_SETCAR (ses, SCM_EOL); \
   delete s;\
   return sizeof (CL);\
 } \