Created
July 9, 2010 23:24
-
-
Save pcapriotti/470240 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From f6a5dd3d1c508bcc3911fda862a53f5eaab7f38a Mon Sep 17 00:00:00 2001 | |
From: Paolo Capriotti <p.capriotti@gmail.com> | |
Date: Sat, 10 Jul 2010 00:23:23 +0100 | |
Subject: [PATCH 2/2] Fix spec for rb_class2name accepting a Module argument. | |
--- | |
vm/capi/class.cpp | 8 -------- | |
vm/capi/module.cpp | 8 ++++++++ | |
2 files changed, 8 insertions(+), 8 deletions(-) | |
diff --git a/vm/capi/class.cpp b/vm/capi/class.cpp | |
index 21fc763..57acd06 100644 | |
--- a/vm/capi/class.cpp | |
+++ b/vm/capi/class.cpp | |
@@ -34,14 +34,6 @@ extern "C" { | |
return env->get_handle(class_object->name()->to_str(env->state())); | |
} | |
- char* rb_class2name(VALUE class_handle) { | |
- NativeMethodEnvironment* env = NativeMethodEnvironment::get(); | |
- Class* class_object = c_as<Class>(env->get_object(class_handle)); | |
- | |
- String* str = class_object->name()->to_str(env->state()); | |
- return RSTRING_PTR(env->get_handle(str)); | |
- } | |
- | |
VALUE rb_class_inherited(VALUE super_handle, VALUE class_handle) | |
{ | |
if(!super_handle) super_handle = rb_cObject; | |
diff --git a/vm/capi/module.cpp b/vm/capi/module.cpp | |
index a3b6d37..f62bf60 100644 | |
--- a/vm/capi/module.cpp | |
+++ b/vm/capi/module.cpp | |
@@ -209,4 +209,12 @@ extern "C" { | |
module->del_const(env->state(), reinterpret_cast<Symbol*>(name)); | |
return Qnil; | |
} | |
+ | |
+ char* rb_class2name(VALUE module_handle) { | |
+ NativeMethodEnvironment* env = NativeMethodEnvironment::get(); | |
+ Module* module_object = c_as<Module>(env->get_object(module_handle)); | |
+ | |
+ String* str = module_object->name()->to_str(env->state()); | |
+ return RSTRING_PTR(env->get_handle(str)); | |
+ } | |
} | |
-- | |
1.7.0.4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment