diff options
author | Nobuyoshi Nakada <[email protected]> | 2016-05-07 11:51:14 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2020-09-07 20:08:01 +0900 |
commit | af5e87ab218c5f4e34c6cdb54ae119a7f0f9033f (patch) | |
tree | e050cf7f7af91f1b990287f6e17d26bc27b6171d /ext/-test-/random/init.c | |
parent | f4d5273989ae8d6569a62b126b2774706b86fbf5 (diff) |
separate rb_random_t
* random.c: separate abstract rb_random_t and rb_random_mt_t for
Mersenne Twister implementation.
* include/ruby/random.h: the interface for extensions of Random
class.
* DLL imported symbol reference is not constant on Windows.
* check if properly initialized.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3024
Diffstat (limited to 'ext/-test-/random/init.c')
-rw-r--r-- | ext/-test-/random/init.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/-test-/random/init.c b/ext/-test-/random/init.c new file mode 100644 index 0000000000..320cba0ad6 --- /dev/null +++ b/ext/-test-/random/init.c @@ -0,0 +1,11 @@ +#include "ruby.h" + +#define init(n) {void Init_random_##n(VALUE mod, VALUE base); Init_random_##n(mod, base);} + +void +Init_random(void) +{ + VALUE base = rb_const_get(rb_cRandom, rb_intern_const("Base")); + VALUE mod = rb_define_module_under(rb_define_module("Bug"), "Random"); + TEST_INIT_FUNCS(init); +} |