summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/openssl/ossl_rand.c22
2 files changed, 14 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index a6876ee329..9e2053916c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Oct 4 08:23:48 2014 Zachary Scott <e@zzak.io>
+
+ * ext/openssl/ossl_rand.c: Use rb_define_module_function instead of
+ macro. [Fixes GH-686] https://github.com/ruby/ruby/pull/686
+
Sat Oct 4 06:04:56 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole_method.c(olemethod_set_member): remove
diff --git a/ext/openssl/ossl_rand.c b/ext/openssl/ossl_rand.c
index d77eb799cd..5481296c90 100644
--- a/ext/openssl/ossl_rand.c
+++ b/ext/openssl/ossl_rand.c
@@ -171,10 +171,6 @@ ossl_rand_status(VALUE self)
return RAND_status() ? Qtrue : Qfalse;
}
-#define DEFMETH(class, name, func, argc) \
- rb_define_method((class), (name), (func), (argc)); \
- rb_define_singleton_method((class), (name), (func), (argc));
-
/*
* INIT
*/
@@ -189,14 +185,14 @@ Init_ossl_rand(void)
eRandomError = rb_define_class_under(mRandom, "RandomError", eOSSLError);
- DEFMETH(mRandom, "seed", ossl_rand_seed, 1);
- DEFMETH(mRandom, "random_add", ossl_rand_add, 2);
- DEFMETH(mRandom, "load_random_file", ossl_rand_load_file, 1);
- DEFMETH(mRandom, "write_random_file", ossl_rand_write_file, 1);
- DEFMETH(mRandom, "random_bytes", ossl_rand_bytes, 1);
- DEFMETH(mRandom, "pseudo_bytes", ossl_rand_pseudo_bytes, 1);
- DEFMETH(mRandom, "egd", ossl_rand_egd, 1);
- DEFMETH(mRandom, "egd_bytes", ossl_rand_egd_bytes, 2);
- DEFMETH(mRandom, "status?", ossl_rand_status, 0)
+ rb_define_module_function(mRandom, "seed", ossl_rand_seed, 1);
+ rb_define_module_function(mRandom, "random_add", ossl_rand_add, 2);
+ rb_define_module_function(mRandom, "load_random_file", ossl_rand_load_file, 1);
+ rb_define_module_function(mRandom, "write_random_file", ossl_rand_write_file, 1);
+ rb_define_module_function(mRandom, "random_bytes", ossl_rand_bytes, 1);
+ rb_define_module_function(mRandom, "pseudo_bytes", ossl_rand_pseudo_bytes, 1);
+ rb_define_module_function(mRandom, "egd", ossl_rand_egd, 1);
+ rb_define_module_function(mRandom, "egd_bytes", ossl_rand_egd_bytes, 2);
+ rb_define_module_function(mRandom, "status?", ossl_rand_status, 0);
}