1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* struct.c (make_struct): fixed: [ruby-core:04402]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2005-02-09 15:55:36 +00:00
parent 9217b68b4a
commit 03d887cade
4 changed files with 13 additions and 5 deletions

View file

@ -1,3 +1,7 @@
Thu Feb 10 00:47:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* struct.c (make_struct): fixed: [ruby-core:04402]
Wed Feb 9 08:07:08 2005 Paul Duncan <pabs@pablotron.org>
* ext/curses/curses.c (window_color_set): [ruby-core:04393]

View file

@ -561,7 +561,7 @@ curses_resizeterm(VALUE obj, VALUE lin, VALUE col)
#endif
}
#ifdef USE_COLOR
#if defined(USE_COLOR) && defined(HAVE_WCOLOR_SET)
static VALUE
curses_start_color(VALUE obj)
{
@ -1195,7 +1195,7 @@ window_setscrreg(VALUE obj, VALUE top, VALUE bottom)
#endif
}
#ifdef USE_COLOR
#if defined(USE_COLOR) && defined(HAVE_WCOLOR_SET)
static VALUE
window_color_set(VALUE obj, VALUE col)
{
@ -1485,9 +1485,9 @@ Init_curses()
rb_define_method(cWindow, "box", window_box, -1);
rb_define_method(cWindow, "move", window_move, 2);
rb_define_method(cWindow, "setpos", window_setpos, 2);
#ifdef USE_COLOR
#if defined(USE_COLOR) && defined(HAVE_WCOLOR_SET)
rb_define_method(cWindow, "color_set", window_color_set, 1);
#endif /* USE_COLOR */
#endif /* USE_COLOR && HAVE_WCOLOR_SET */
rb_define_method(cWindow, "cury", window_cury, 0);
rb_define_method(cWindow, "curx", window_curx, 0);
rb_define_method(cWindow, "maxy", window_maxy, 0);

View file

@ -19,7 +19,7 @@ elsif have_header(*curses=%w"curses.h") and have_library("curses", "initscr")
end
if make
for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash getbkgd getnstr init isendwin keyname keypad resizeterm scrl set setscrreg ungetch wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr wresize wscrl wsetscrreg def_prog_mode reset_prog_mode timeout wtimeout nodelay init_color)
for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash getbkgd getnstr init isendwin keyname keypad resizeterm scrl set setscrreg ungetch wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr wresize wscrl wsetscrreg def_prog_mode reset_prog_mode timeout wtimeout nodelay init_color wcolor_set)
have_func(f)
end
flag = "-D_XOPEN_SOURCE_EXTENDED"

View file

@ -212,6 +212,10 @@ make_struct(name, members, klass)
rb_define_singleton_method(nstr, "members", rb_struct_s_members_m, 0);
for (i=0; i< RARRAY(members)->len; i++) {
ID id = SYM2ID(RARRAY(members)->ptr[i]);
if (!rb_is_local_id(id)) {
rb_raise(rb_eNameError, "`%s' is not proper name for a struct member",
rb_id2name(id));
}
if (i<10) {
rb_define_method_id(nstr, id, ref_func[i], 0);
}