[macruby-changes] [480] MacRuby/trunk/objc.h

source_changes at macosforge.org source_changes at macosforge.org
Mon Aug 25 18:29:51 PDT 2008


Revision: 480
          http://trac.macosforge.org/projects/ruby/changeset/480
Author:   lsansonetti at apple.com
Date:     2008-08-25 18:29:51 -0700 (Mon, 25 Aug 2008)
Log Message:
-----------
forgot to add this file

Added Paths:
-----------
    MacRuby/trunk/objc.h

Added: MacRuby/trunk/objc.h
===================================================================
--- MacRuby/trunk/objc.h	                        (rev 0)
+++ MacRuby/trunk/objc.h	2008-08-26 01:29:51 UTC (rev 480)
@@ -0,0 +1,27 @@
+#ifndef __OBJC_H_
+#define __OBJC_H_
+
+static inline void
+rb_objc_install_method(Class klass, SEL sel, IMP imp)
+{
+    Method method, method2;
+
+    method = class_getInstanceMethod(klass, sel);
+    assert(method != NULL);
+ 
+    method2 = class_getInstanceMethod((Class)RCLASS_SUPER(klass), sel);
+    if (method == method2)  {
+	assert(class_addMethod(klass, sel, imp, method_getTypeEncoding(method)));
+    }
+    else {
+	method_setImplementation(method, imp);
+    }
+}
+
+static inline void
+rb_objc_install_method2(Class klass, const char *selname, IMP imp)
+{
+    rb_objc_install_method(klass, sel_registerName(selname), imp);
+}
+
+#endif /* __OBJC_H_ */


Property changes on: MacRuby/trunk/objc.h
___________________________________________________________________
Name: svn:eol-style
   + native
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080825/481f3801/attachment.html 


More information about the macruby-changes mailing list