* 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
This commit is contained in:
zzak 2014-10-03 23:24:50 +00:00
Родитель f895ecdcee
Коммит ce63c19ccc
2 изменённых файлов: 14 добавлений и 13 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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);
}