aalib: update for ncurses-6.5

Without the change build fails on `ncurses-6.5` with opaque WINDOW as:

    aacurses.c: In function 'curses_getsize':
    aacurses.c:74:20: error: invalid use of incomplete typedef 'WINDOW' {aka 'struct _wi
n_st'}
       74 |     *width = stdscr->_maxx + 1;
          |                    ^~

The change uses `gemaxx()` / `getmaxy()` instead.
This commit is contained in:
Sergei Trofimovich
2024-11-10 19:08:24 +00:00
parent 343b0a2225
commit cca2dab0de
2 changed files with 26 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
Without the change build fails on ncurses-6.5 (enables opaque WINDOW by
default) as:
aacurses.c: In function 'curses_getsize':
aacurses.c:74:20: error: invalid use of incomplete typedef 'WINDOW' {aka 'struct _win_st'}
74 | *width = stdscr->_maxx + 1;
| ^~
--- a/src/aacurses.c
+++ b/src/aacurses.c
@@ -71,8 +71,8 @@ static void curses_getsize(aa_context * c, int *width, int *height)
{
if (__resized_curses)
curses_uninit(c), curses_init(&c->params, NULL,&c->driverparams, NULL), __resized_curses = 0;
- *width = stdscr->_maxx + 1;
- *height = stdscr->_maxy + 1;
+ *width = getmaxx(stdscr);
+ *height = getmaxy(stdscr);
#ifdef GPM_MOUSEDRIVER
gpm_mx = *width;
gpm_my = *height;
+6 -1
View File
@@ -12,7 +12,12 @@ stdenv.mkDerivation rec {
outputs = [ "bin" "dev" "out" "man" "info" ];
setOutputFlags = false; # Doesn't support all the flags
patches = [ ./clang.patch ] # Fix implicit `int` on `main` error with newer versions of clang
patches = [
# Fix implicit `int` on `main` error with newer versions of clang
./clang.patch
# Fix build against opaque aalib API
./ncurses-6.5.patch
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ ./darwin.patch ];
# The fuloong2f is not supported by aalib still