Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06c38a6

Browse files
ioquatixeregon
authored andcommitted
2.6 compatibility.
1 parent b4543ab commit 06c38a6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/io/console/console.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@ console_set_winsize(VALUE io, VALUE size)
845845
VALUE row, col, xpixel, ypixel;
846846
const VALUE *sz;
847847
long sizelen;
848+
int fd;
848849

849850
size = rb_Array(size);
850851
if ((sizelen = RARRAY_LEN(size)) != 2 && sizelen != 4) {
@@ -853,7 +854,7 @@ console_set_winsize(VALUE io, VALUE size)
853854
sz = RARRAY_CONST_PTR(size);
854855
row = sz[0], col = sz[1], xpixel = ypixel = Qnil;
855856
if (sizelen == 4) xpixel = sz[2], ypixel = sz[3];
856-
int fd = GetWriteFD(io);
857+
fd = GetWriteFD(io);
857858
#if defined TIOCSWINSZ
858859
ws.ws_row = ws.ws_col = ws.ws_xpixel = ws.ws_ypixel = 0;
859860
#define SET(m) ws.ws_##m = NIL_P(m) ? 0 : (unsigned short)NUM2UINT(m)
@@ -1399,7 +1400,7 @@ console_clear_screen(VALUE io)
13991400

14001401
#ifndef HAVE_RB_IO_OPEN_DESCRIPTOR
14011402
static VALUE
1402-
rb_io_open_descriptor(VALUE klass, int descriptor, int mode, VALUE path, VALUE timeout, rb_io_enc_t *encoding)
1403+
io_open_descriptor_fallback(VALUE klass, int descriptor, int mode, VALUE path, VALUE timeout, void *encoding)
14031404
{
14041405
rb_update_max_fd(descriptor);
14051406

@@ -1417,6 +1418,7 @@ rb_io_open_descriptor(VALUE klass, int descriptor, int mode, VALUE path, VALUE t
14171418

14181419
return self;
14191420
}
1421+
#define rb_io_open_descriptor io_open_descriptor_fallback
14201422
#endif
14211423

14221424
#ifndef HAVE_RB_IO_CLOSED_P

0 commit comments

Comments
 (0)