diff options
Diffstat (limited to 'ext/mwrap/mwrap.c')
-rw-r--r-- | ext/mwrap/mwrap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/mwrap/mwrap.c b/ext/mwrap/mwrap.c index d88fee6..a45bb38 100644 --- a/ext/mwrap/mwrap.c +++ b/ext/mwrap/mwrap.c @@ -6,6 +6,7 @@ #include "mwrap_core.h" static ID id_uminus; +extern VALUE __attribute__((weak)) rb_stderr; extern VALUE __attribute__((weak)) rb_cObject; extern VALUE __attribute__((weak)) rb_eTypeError; extern VALUE __attribute__((weak)) rb_yield(VALUE); @@ -33,7 +34,7 @@ static VALUE mwrap_dump(int argc, VALUE *argv, VALUE mod) if (NIL_P(io)) /* library may be linked w/o Ruby */ - io = *((VALUE *)dlsym(RTLD_DEFAULT, "rb_stderr")); + io = rb_stderr; a.min = NIL_P(min) ? 0 : NUM2SIZET(min); io = rb_io_get_io(io); |