Bug#1057602: scm: FTBFS: error: invalid use of incomplete typedef ‘WINDOW’ {aka ‘struct _win_st’}
Control: tags -1 + patch
On 2023-12-05 23:11 +0100, Santiago Vila wrote:
> Package: src:scm
> Version: 5f3-4
> Severity: serious
> Tags: ftbfs
>
> Dear maintainer:
>
> During a rebuild of all packages in unstable, your package failed to build:
> [...]
>
> The above is just how the build ends and not necessarily the most relevant part.
Indeed, the actual error causing the FTBFS was missing.
> If required, the full build log is available here:
>
> https://people.debian.org/~sanvila/build-logs/202312/
The only fatal errors are these two:
,----
| crs.c: In function ‘owidth’:
| crs.c:253:43: error: invalid use of incomplete typedef ‘WINDOW’ {aka ‘struct _win_st’}
| 253 | if (WINP(arg)) return MAKINUM(WIN(arg)->_maxx+1);
| | ^~
| scmfig.h:556:24: note: in definition of macro ‘MAKINUM’
| 556 | # define MAKINUM(x) (((x)<<2)+2L)
| | ^
| crs.c: In function ‘oheight’:
| crs.c:264:43: error: invalid use of incomplete typedef ‘WINDOW’ {aka ‘struct _win_st’}
| 264 | if (WINP(arg)) return MAKINUM(WIN(arg)->_maxy+1);
| | ^~
`----
The attached patch fixes them and lets the package build, but I have
not tested if it actually works.
Cheers,
Sven
Description: Fix build with opaque ncurses
Since ncurses patchlevel 20231021 the WINDOW structure is opaque, its
members cannot be addressed directly. Use the functions ncurses
provides for this purpose instead.
Author: Sven Joachim <svenjoac@gmx.de>
Bug-Debian: https://bugs.debian.org/1057602
--- scm-5f3.orig/crs.c
+++ scm-5f3/crs.c
@@ -250,7 +250,7 @@ SCM owidth(arg)
if (UNBNDP(arg)) arg = cur_outp;
ASRTER(NIMP(arg) && OPOUTPORTP(arg), arg, ARG1, s_owidth);
if (NIMP(*loc_stdscr)) {
- if (WINP(arg)) return MAKINUM(WIN(arg)->_maxx+1);
+ if (WINP(arg)) return MAKINUM(getmaxx(WIN(arg)));
else return MAKINUM(COLS);
}
return MAKINUM(80);
@@ -261,7 +261,7 @@ SCM oheight(arg)
if (UNBNDP(arg)) arg = cur_outp;
ASRTER(NIMP(arg) && OPOUTPORTP(arg), arg, ARG1, s_owidth);
if (NIMP(*loc_stdscr))
- if (WINP(arg)) return MAKINUM(WIN(arg)->_maxy+1);
+ if (WINP(arg)) return MAKINUM(getmaxy(WIN(arg)));
else return MAKINUM(LINES);
return MAKINUM(24);
}
Reply to: