diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-02-04 21:57:45 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-02-04 21:57:45 +0000 |
commit | 9f51099a6651d314d1ff5a435b6bc349d3472486 (patch) | |
tree | ed1b5ebd5b048838d1d53f6612b72f48aa50edd2 | |
parent | 2cc41c38dc270ff764a5cc58fd81fbdacde9ff4b (diff) | |
download | sleepy_penguin-9f51099a6651d314d1ff5a435b6bc349d3472486.tar.gz |
This can avoid confusion/conflicts in case we link with newer versions that have the missing symbols.
-rw-r--r-- | ext/sleepy_penguin/epoll.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/sleepy_penguin/epoll.c b/ext/sleepy_penguin/epoll.c index b439390..12babad 100644 --- a/ext/sleepy_penguin/epoll.c +++ b/ext/sleepy_penguin/epoll.c @@ -14,18 +14,20 @@ #define EP_RECREATE (-2) #ifndef HAVE_RB_MEMERROR -static void rb_memerror(void) +static void my_memerror(void) { static const char e[] = "[FATAL] failed to allocate memory\n"; write(2, e, sizeof(e) - 1); abort(); } +#define rb_memerror my_memerror #endif #ifndef HAVE_RB_IO_CLOSE -static VALUE rb_io_close(VALUE io) +static VALUE my_io_close(VALUE io) { return rb_funcall(io, rb_intern("close"), 0); } +#define rb_io_close my_io_close #endif static st_table *active; @@ -70,7 +72,7 @@ static struct rb_epoll *ep_get(VALUE self) * Don't worry about thread-safety since current Ruby 1.9 won't * call this without GVL. */ -static int epoll_create1(int flags) +static int my_epoll_create1(int flags) { int fd = epoll_create(1024); /* size ignored since 2.6.8 */ @@ -88,6 +90,7 @@ err: return -1; } } +#define epoll_create1 my_epoll_create1 #endif static void gcmark(void *ptr) |