diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-03 23:24:50 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-03 23:24:50 +0000 |
commit | ce63c19cccc250dad14f54310b99e11e5375d24f (patch) | |
tree | ad81bf4ee8f693586c97c0643ba9af9a41b5d2a4 /ext | |
parent | f895ecdceec45c8213ec0fc1a0d8b75e11fb545d (diff) |
* ext/openssl/ossl_rand.c: Use rb_define_module_function instead of
macro. [Fixes GH-686] https://github.com/ruby/ruby/pull/686
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/openssl/ossl_rand.c | 22 |
1 files changed, 9 insertions, 13 deletions
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); } |