diff options
author | Eric Wong <e@80x24.org> | 2023-01-08 05:20:44 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-01-08 21:41:36 +0000 |
commit | babee7d4dfbf0771621f51dc1e438fad019efe1e (patch) | |
tree | b241f783f28272ca60f88ccbc25aa1dac27efbed /ext/mwrap | |
parent | 8ae75563b2ef53be721338faada7b29717b56541 (diff) | |
download | mwrap-babee7d4dfbf0771621f51dc1e438fad019efe1e.tar.gz |
A weak symbol works fine, here.
Diffstat (limited to 'ext/mwrap')
-rw-r--r-- | ext/mwrap/mwrap.c | 3 | ||||
-rw-r--r-- | ext/mwrap/mwrap_core.h | 1 |
2 files changed, 2 insertions, 2 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); diff --git a/ext/mwrap/mwrap_core.h b/ext/mwrap/mwrap_core.h index c0eea2f..721e5d3 100644 --- a/ext/mwrap/mwrap_core.h +++ b/ext/mwrap/mwrap_core.h @@ -26,7 +26,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <dlfcn.h> #include <assert.h> #include <errno.h> #include <sys/types.h> |