[macruby-changes] [2526] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Sep 9 00:17:27 PDT 2009


Revision: 2526
          http://trac.macosforge.org/projects/ruby/changeset/2526
Author:   lsansonetti at apple.com
Date:     2009-09-09 00:17:21 -0700 (Wed, 09 Sep 2009)
Log Message:
-----------
Init_ functions may never have underscore characters

Modified Paths:
--------------
    MacRuby/trunk/bin/rubyc
    MacRuby/trunk/dln.c

Modified: MacRuby/trunk/bin/rubyc
===================================================================
--- MacRuby/trunk/bin/rubyc	2009-09-09 07:11:20 UTC (rev 2525)
+++ MacRuby/trunk/bin/rubyc	2009-09-09 07:17:21 UTC (rev 2526)
@@ -120,7 +120,7 @@
       die "can't guess the init function of Ruby object file `#{obj}'"
     end
 
-    init_func = "Init_" + base
+    init_func = "Init_" + base.gsub(/-/, '_')
     main_txt = <<EOS
 extern "C" {
   void *#{real_init_func}(void *, void *);

Modified: MacRuby/trunk/dln.c
===================================================================
--- MacRuby/trunk/dln.c	2009-09-09 07:11:20 UTC (rev 2525)
+++ MacRuby/trunk/dln.c	2009-09-09 07:17:21 UTC (rev 2526)
@@ -37,8 +37,14 @@
     *buf = xmalloc(len);
     snprintf(*buf, len, FUNCNAME_PATTERN, slash + 1);
     for (p = *buf; *p; p++) {         /* Delete suffix if it exists */
+	if (*p == '-') {
+	    *p = '_';
+	}
+    }
+    for (p = *buf; *p; p++) {         /* Delete suffix if it exists */
 	if (*p == '.') {
-	    *p = '\0'; break;
+	    *p = '\0';
+	    break;
 	}
     }
     return p - *buf;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090909/235aa03f/attachment.html>


More information about the macruby-changes mailing list