diffstat for ruby-ncurses-1.4.11 ruby-ncurses-1.4.13

 Changes          |    6 ++++
 debian/changelog |    8 +++++
 extconf.rb       |    8 -----
 ncurses_wrap.c   |   77 +++++++++++++++++++++++++++++--------------------------
 ncursesw.gemspec |    2 -
 5 files changed, 56 insertions(+), 45 deletions(-)

diff -Nru ruby-ncurses-1.4.11/Changes ruby-ncurses-1.4.13/Changes
--- ruby-ncurses-1.4.11/Changes	2024-04-21 02:16:50.000000000 +0300
+++ ruby-ncurses-1.4.13/Changes	2025-05-18 07:45:53.000000000 +0300
@@ -1,3 +1,9 @@
+ncurses-ruby-1.4.13
+ * Fixed compilation errors under C23 due to unprototyped functions.
+
+ncurses-ruby-1.4.12
+ * Fixed getch non-blocking behaviour with NCURSES_OPAQUE.
+
 ncurses-ruby-1.4.11
  * Fixed some incorrectly declared method arguments.
  * Fixed warnings about "undefining the allocator of T_DATA class".
diff -Nru ruby-ncurses-1.4.11/debian/changelog ruby-ncurses-1.4.13/debian/changelog
--- ruby-ncurses-1.4.11/debian/changelog	2024-08-09 04:01:02.000000000 +0300
+++ ruby-ncurses-1.4.13/debian/changelog	2025-10-05 20:59:14.000000000 +0300
@@ -1,3 +1,11 @@
+ruby-ncurses (1.4.13-0.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * New upstream release.
+    - Fixes FTBFS with GCC 15. (Closes: #1097819)
+
+ -- Adrian Bunk <bunk@debian.org>  Sun, 05 Oct 2025 20:59:14 +0300
+
 ruby-ncurses (1.4.11-1) unstable; urgency=medium
 
   * Team upload.
diff -Nru ruby-ncurses-1.4.11/extconf.rb ruby-ncurses-1.4.13/extconf.rb
--- ruby-ncurses-1.4.11/extconf.rb	2024-04-21 02:16:50.000000000 +0300
+++ ruby-ncurses-1.4.13/extconf.rb	2025-05-18 07:45:53.000000000 +0300
@@ -174,14 +174,6 @@
   $CFLAGS  += " -DHAVE_RB_THREAD_FD_SELECT"
 end
 
-# Avoid dereferencing WINDOW pointers on FreeBSD
-if RUBY_PLATFORM =~ /freebsd/
-  $CFLAGS += " -DNCURSES_OPAQUE=1"
-else
-  # add NCURSES_OPAQUE for mac
-  $CFLAGS += " -DNCURSES_OPAQUE=0"
-end
-
 if have_func("clock_gettime")
   $CFLAGS += " -DHAVE_CLOCK_GETTIME"
 end
diff -Nru ruby-ncurses-1.4.11/ncursesw.gemspec ruby-ncurses-1.4.13/ncursesw.gemspec
--- ruby-ncurses-1.4.11/ncursesw.gemspec	2024-04-21 02:16:50.000000000 +0300
+++ ruby-ncurses-1.4.13/ncursesw.gemspec	2025-05-18 07:45:53.000000000 +0300
@@ -6,7 +6,7 @@
 
 spec = Gem::Specification.new do |s|
   s.name        = 'ncursesw'
-  s.version     = '1.4.11'
+  s.version     = '1.4.13'
   s.license     = 'LGPL-2.1'
   s.platform    = Gem::Platform::RUBY
   s.authors     = ['Tobias Herzke', 'Sup developers']
diff -Nru ruby-ncurses-1.4.11/ncurses_wrap.c ruby-ncurses-1.4.13/ncurses_wrap.c
--- ruby-ncurses-1.4.11/ncurses_wrap.c	2024-04-21 02:16:50.000000000 +0300
+++ ruby-ncurses-1.4.13/ncurses_wrap.c	2025-05-18 07:45:53.000000000 +0300
@@ -146,9 +146,9 @@
 #endif
 }
 
-static VALUE rbncurs_COLORS()
+static VALUE rbncurs_COLORS(VALUE dummy)
 {return INT2NUM(COLORS);}
-static VALUE rbncurs_COLOR_PAIRS()
+static VALUE rbncurs_COLOR_PAIRS(VALUE dummy)
 {return INT2NUM(COLOR_PAIRS);}
 
 static
@@ -233,6 +233,7 @@
         if (rb_window == Qnil) {
             rb_window = Data_Wrap_Struct(cWINDOW, 0, 0, window);
             rb_iv_set(rb_window, "@destroyed", Qfalse);
+            rb_iv_set(rb_window, "@timeout", INT2FIX(-1));
             rb_hash_aset(windows_hash, window_adress, rb_window);
         }
         return rb_window;
@@ -370,7 +371,7 @@
     NCFUNC(wgetnstr, 3);
 }
 
-static VALUE get_stdscr()
+static VALUE get_stdscr(VALUE dummy)
 {
     VALUE rb_stdscr = rb_iv_get(mNcurses, "@stdscr");
     if (rb_stdscr == Qnil) {
@@ -379,7 +380,7 @@
     }
     return rb_stdscr;
 }
-static VALUE get_curscr()
+static VALUE get_curscr(VALUE dummy)
 {
     VALUE rb_curscr = rb_iv_get(mNcurses, "@curscr");
     if (rb_curscr == Qnil) {
@@ -389,7 +390,7 @@
     return rb_curscr;
 }
 #ifdef HAVE_NEWSCR
-static VALUE get_newscr()
+static VALUE get_newscr(VALUE dummy)
 {
     VALUE rb_newscr = rb_iv_get(mNcurses, "@newscr");
     if (rb_newscr == Qnil) {
@@ -399,15 +400,15 @@
     return rb_newscr;
 }
 #endif
-static VALUE get_LINES()   {return INT2NUM(LINES);}
-static VALUE get_COLS()    {return INT2NUM(COLS);}
+static VALUE get_LINES(VALUE dummy)   {return INT2NUM(LINES);}
+static VALUE get_COLS(VALUE dummy)    {return INT2NUM(COLS);}
 #ifdef HAVE_TABSIZE
-static VALUE get_TABSIZE() {return INT2NUM(TABSIZE);}
+static VALUE get_TABSIZE(VALUE dummy) {return INT2NUM(TABSIZE);}
 #endif
 #ifdef HAVE_ESCDELAY
 /* This global was an undocumented feature under AIX curses. */
 /* ESC expire time in milliseconds                           */
-static VALUE get_ESCDELAY(){return INT2NUM(ESCDELAY);}
+static VALUE get_ESCDELAY(VALUE dummy){return INT2NUM(ESCDELAY);}
 static VALUE set_ESCDELAY(VALUE dummy, VALUE new_delay)
 {
     ESCDELAY=NUM2INT(new_delay);
@@ -418,7 +419,7 @@
 /* This global is wrapper-specific. It denotes the interval after which the
    terminal is periodically checked for having resized or not. */
 /* time in milliseconds                           */
-static VALUE get_RESIZEDELAY(){return rb_iv_get(mNcurses, "@resize_delay");}
+static VALUE get_RESIZEDELAY(VALUE dummy){return rb_iv_get(mNcurses, "@resize_delay");}
 static VALUE set_RESIZEDELAY(VALUE dummy, VALUE rb_new_delay)
 {
     int c_new_delay = NUM2INT(rb_new_delay);
@@ -479,7 +480,7 @@
 }
 #endif
 #ifdef HAVE_CURSES_VERSION
-static VALUE rbncurs_curses_version(){return rb_str_new2(curses_version());}
+static VALUE rbncurs_curses_version(VALUE dummy){return rb_str_new2(curses_version());}
 #endif
 #ifdef HAVE_DEFINE_KEY
 static VALUE rbncurs_define_key(VALUE dummy, VALUE definition, VALUE keycode)
@@ -503,7 +504,7 @@
 }
 #endif
 #ifdef HAVE_USE_DEFAULT_COLORS
-static VALUE rbncurs_use_default_colors()
+static VALUE rbncurs_use_default_colors(VALUE dummy)
 {
     return INT2NUM(use_default_colors());
 }
@@ -838,22 +839,17 @@
 typedef int (*wgetch_func) (WINDOW *);
 
 /* functor for getting a char nonblocking, pass getchar function */
-static int rbncurshelper_do_wgetch_functor (WINDOW *c_win, wgetch_func _wgetch_func) {
+static int rbncurshelper_do_wgetch_functor (WINDOW *c_win, wgetch_func _wgetch_func, int windelay) {
     /* nonblocking wgetch only implemented for Ncurses */
     int halfdelay = NUM2INT(rb_iv_get(mNcurses, "@halfdelay"));
     int infd = NUM2INT(rb_iv_get(mNcurses, "@infd"));
     double screen_delay = halfdelay * 0.1;
-#if defined(NCURSES_VERSION) && defined(NCURSES_OPAQUE) && !NCURSES_OPAQUE
-    int windelay = c_win->_delay;
-#else
-    int windelay = 0;
-#endif
     double window_delay = (windelay >= 0) ? 0.001 * windelay : (1e200*1e200);
     /* FIXME:                                                  ^ Infinity ^*/
     double delay = (screen_delay > 0) ? screen_delay : window_delay;
     int result;
     double starttime, nowtime, finishtime;
-    double resize_delay = NUM2INT(get_RESIZEDELAY()) / 1000.0;
+    double resize_delay = NUM2INT(get_RESIZEDELAY(mNcurses)) / 1000.0;
     fd_set in_fds;
 #ifdef HAVE_CLOCK_GETTIME
     struct timespec tv;
@@ -867,9 +863,7 @@
     starttime = tv.tv_sec + tv.tv_usec * 1e-6;
 #endif
     finishtime = starttime + delay;
-#if defined(NCURSES_VERSION) && defined(NCURSES_OPAQUE) && !NCURSES_OPAQUE
-    c_win->_delay = 0;
-#endif
+    wtimeout(c_win, 0);
     while (doupdate() /* detects resize */, (result = _wgetch_func(c_win)) == ERR) {
 #ifdef HAVE_RB_THREAD_FD_SELECT
       rb_fdset_t fdsets[3];
@@ -922,15 +916,13 @@
 #endif
 #endif
     }
-#if defined(NCURSES_VERSION) && defined(NCURSES_OPAQUE) && !NCURSES_OPAQUE
-    c_win->_delay = windelay;
-#endif
+    wtimeout(c_win, windelay);
     return result;
 }
 
 /* non-wide char getch */
-static int rbncurshelper_nonblocking_wgetch(WINDOW *c_win) {
-  return rbncurshelper_do_wgetch_functor (c_win, &wgetch);
+static int rbncurshelper_nonblocking_wgetch(WINDOW *c_win, int windelay) {
+  return rbncurshelper_do_wgetch_functor (c_win, &wgetch, windelay);
 }
 
 #ifdef HAVE_GET_WCH
@@ -942,20 +934,22 @@
 
 /* return array with first element being return key code status,
  * and second element the key code */
-static VALUE rbncurshelper_nonblocking_wget_wch(WINDOW *c_win) {
-  int retcode = rbncurshelper_do_wgetch_functor (c_win, &my_wget_wch);
+static VALUE rbncurshelper_nonblocking_wget_wch(WINDOW *c_win, int windelay) {
+  int retcode = rbncurshelper_do_wgetch_functor (c_win, &my_wget_wch, windelay);
   VALUE r = rb_assoc_new (INT2NUM(retcode), LONG2NUM(wget_wch_back));
   return r;
 }
 #endif
 
 static VALUE rbncurs_getch(VALUE dummy) {
-    return INT2NUM(rbncurshelper_nonblocking_wgetch(stdscr));
+    int windelay = NUM2INT(rb_iv_get(get_stdscr(dummy), "@timeout"));
+    return INT2NUM(rbncurshelper_nonblocking_wgetch(stdscr, windelay));
 }
 
 #ifdef HAVE_GET_WCH
 static VALUE rbncurs_get_wch(VALUE dummy) {
-    return rbncurshelper_nonblocking_wget_wch(stdscr);
+    int windelay = NUM2INT(rb_iv_get(get_stdscr(dummy), "@timeout"));
+    return rbncurshelper_nonblocking_wget_wch(stdscr, windelay);
 }
 #endif
 
@@ -1191,9 +1185,10 @@
     return INT2NUM(mvderwin(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3)));
 }
 static VALUE rbncurs_mvgetch(VALUE dummy, VALUE arg1, VALUE arg2) {
+    int windelay = NUM2INT(rb_iv_get(get_stdscr(dummy), "@timeout"));
     if (wmove(stdscr, NUM2INT(arg1),  NUM2INT(arg2)) == ERR)
         return INT2NUM(ERR);
-    return INT2NUM(rbncurshelper_nonblocking_wgetch(stdscr));
+    return INT2NUM(rbncurshelper_nonblocking_wgetch(stdscr, windelay));
 }
 #ifdef HAVE_MVHLINE
 static VALUE rbncurs_mvhline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
@@ -1253,9 +1248,10 @@
 }
 static VALUE rbncurs_mvwgetch(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
     WINDOW * c_win = get_window(arg1);
+    int windelay = NUM2INT(rb_iv_get(arg1, "@timeout"));
     if (wmove(c_win, NUM2INT(arg1),  NUM2INT(arg2)) == ERR)
         return INT2NUM(ERR);
-    return INT2NUM(rbncurshelper_nonblocking_wgetch(c_win));
+    return INT2NUM(rbncurshelper_nonblocking_wgetch(c_win, windelay));
 }
 #ifdef HAVE_MVWHLINE
 static VALUE rbncurs_mvwhline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) {
@@ -1298,7 +1294,12 @@
     return INT2NUM(rbncurshelper_halfdelay_cbreak(0, 0));
 }
 static VALUE rbncurs_nodelay(VALUE dummy, VALUE arg1, VALUE arg2) {
-    return INT2NUM(nodelay(get_window(arg1),  RTEST(arg2)));
+    bool flag = RTEST(arg2);
+    int return_value = nodelay(get_window(arg1), flag);
+    if (return_value != ERR) {
+        rb_iv_set(arg1, "@timeout", INT2FIX(flag ? 0 : -1));
+    }
+    return INT2NUM(return_value);
 }
 static VALUE rbncurs_noecho(VALUE dummy) {
     return INT2NUM(noecho());
@@ -1498,6 +1499,7 @@
 }
 #endif
 static VALUE rbncurs_timeout(VALUE dummy, VALUE arg1) {
+    rb_iv_set(get_stdscr(dummy), "@timeout", arg1);
     return ((timeout(NUM2INT(arg1))),Qnil);
 }
 static VALUE rbncurs_typeahead(VALUE dummy, VALUE arg1) {
@@ -1603,12 +1605,14 @@
     return INT2NUM(werase(get_window(arg1)));
 }
 static VALUE rbncurs_wgetch(VALUE dummy, VALUE arg1) {
-    return INT2NUM(rbncurshelper_nonblocking_wgetch(get_window(arg1)));
+    int windelay = NUM2INT(rb_iv_get(arg1, "@timeout"));
+    return INT2NUM(rbncurshelper_nonblocking_wgetch(get_window(arg1), windelay));
 }
 
 #ifdef HAVE_GET_WCH
 static VALUE rbncurs_wget_wch(VALUE dummy, VALUE arg1) {
-    return rbncurshelper_nonblocking_wget_wch(get_window(arg1));
+    int windelay = NUM2INT(rb_iv_get(arg1, "@timeout"));
+    return rbncurshelper_nonblocking_wget_wch(get_window(arg1), windelay);
 }
 #endif
 
@@ -1664,6 +1668,7 @@
     return ((wsyncup(get_window(arg1))),Qnil);
 }
 static VALUE rbncurs_wtimeout(VALUE dummy, VALUE arg1, VALUE arg2) {
+    rb_iv_set(arg1, "@timeout", arg2);
     return ((wtimeout(get_window(arg1),  NUM2INT(arg2))),Qnil);
 }
 static VALUE rbncurs_wtouchln(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
