Permalink
Browse files

Merge pull request #613 from bovi/mrbgems-example

mrbgems - remove static RClass
  • Loading branch information...
2 parents b6c9a25 + 9141ffc commit 57482ef3f04f158b9ec2f73369e1b697de8124c3 @matz matz committed Dec 10, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 doc/mrbgems/c_extension_example/src/example.c
@@ -1,8 +1,6 @@
#include <mruby.h>
#include <stdio.h>
-static struct RClass *_class_cextension;
-
static mrb_value
mrb_c_method(mrb_state *mrb, mrb_value self)
{
@@ -12,6 +10,6 @@ mrb_c_method(mrb_state *mrb, mrb_value self)
void
mrb_c_extension_example_gem_init(mrb_state* mrb) {
- _class_cextension = mrb_define_module(mrb, "CExtension");
- mrb_define_class_method(mrb, _class_cextension, "c_method", mrb_c_method, ARGS_NONE());
+ struct RClass *class_cextension = mrb_define_module(mrb, "CExtension");
+ mrb_define_class_method(mrb, class_cextension, "c_method", mrb_c_method, ARGS_NONE());
}

0 comments on commit 57482ef

Please sign in to comment.