From f9c63857f83cbd427b0b0e57f28c20b1322f78ae Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 18 May 1998 09:12:27 +0000 Subject: BeOS patches git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- error.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'error.c') diff --git a/error.c b/error.c index 9c024dddd8..d8a96e5080 100644 --- a/error.c +++ b/error.c @@ -507,6 +507,27 @@ syserr_errno(self) return rb_iv_get(self, "errno"); } +#ifdef __BEOS__ +static VALUE +get_syserr(int i) +{ + VALUE *list; + int ix, offset; + + i -= B_GENERAL_ERROR_BASE; + ix = (i >> 12) & 0xf; + offset = (i >> 8) & 0xf; + if (offset < syserr_index[ix].n) { + ix = syserr_index[ix].ix; + if ((i & 0xff) < syserr_list[ix + offset].n) { + list = syserr_list[ix + offset].list; + return list[i & 0xff]; + } + } + return 0; +} +#endif /* __BEOS__ */ + static void init_syserr _((void)); void -- cgit v1.2.3