Revision: 3121 http://trac.macosforge.org/projects/ruby/changeset/3121 Author: pthomson@apple.com Date: 2009-12-14 18:35:38 -0800 (Mon, 14 Dec 2009) Log Message: ----------- Fixed a whole lot of crashes on 32-bit, including issue 448. Modified Paths: -------------- MacRuby/trunk/include/ruby/ruby.h Modified: MacRuby/trunk/include/ruby/ruby.h =================================================================== --- MacRuby/trunk/include/ruby/ruby.h 2009-12-15 02:10:31 UTC (rev 3120) +++ MacRuby/trunk/include/ruby/ruby.h 2009-12-15 02:35:38 UTC (rev 3121) @@ -570,13 +570,13 @@ # define RCLASS_RC_FLAGS(m) (*(uint32_t *) ((_PTR_TYPE)(m) + sizeof(uintptr_t) + (sizeof(uint8_t) * 4))) # else # define _PTR_TYPE uint32_t -# define RCLASS_VERSION(m) (*(long *)((_PTR_TYPE)m + (sizeof(void *) * 3))) -# define RCLASS_SET_VERSION(m,f) do { RCLASS_VERSION(m) = f; } while (0) -# define RCLASS_SET_VERSION_FLAG(m,f) (RCLASS_VERSION(m) |= f) +# define RCLASS_VERSION(m) (class_getVersion((Class)m)) +# define RCLASS_SET_VERSION(m,f) (class_setVersion((Class)m, f)) +# define RCLASS_SET_VERSION_FLAG(m,f) (class_setVersion((Class)m, (RCLASS_VERSION(m) | f))) # define RCLASS_SUPER(m) (*(VALUE *)((_PTR_TYPE)m + (sizeof(void *) * 1))) -# define RCLASS_SET_SUPER(m, s) (RCLASS_SUPER(m) = s) -# define _RCLASS_INFO(m) (*(long *)((_PTR_TYPE)m + (sizeof(void *) * 4))) -# define RCLASS_META(m) (_RCLASS_INFO(m) & CLS_META) +# define RCLASS_SET_SUPER(m, s) (class_setSuperclass((Class)m, (Class)s)) +# define RCLASS_META(m) (class_isMetaClass((Class)m)) +# define RCLASS_RC_FLAGS(m) (*(uint32_t *) ((_PTR_TYPE)(m) + sizeof(uintptr_t) + (sizeof(uint8_t) * 4))) # endif # define RCLASS_RUBY(m) ((RCLASS_VERSION(m) & RCLASS_IS_RUBY_CLASS) == RCLASS_IS_RUBY_CLASS) # define RCLASS_MODULE(m) ((RCLASS_VERSION(m) & RCLASS_IS_MODULE) == RCLASS_IS_MODULE)
participants (1)
-
source_changes@macosforge.org