Control: tags -1 + trixie sid patch

On 2023-12-05 23:04 +0100, Santiago Vila wrote:

> Package: src:dosbox
> Version: 0.74-3-4
> Severity: serious
> Tags: ftbfs
>
> During a rebuild of all packages in unstable, your package failed to build:
> In file included from ../../../src/debug/debug_gui.cpp:28:
> ../../../src/debug/debug_gui.cpp: In function ‘void DrawBars()’:
> ../../../src/debug/debug_gui.cpp:149:29: error: invalid use of incomplete 
> type ‘WINDOW’ {aka ‘struct _win_st’}
>   149 |         mvaddstr(dbg.win_reg->_begy-1,0, "---(Register Overview       
>             )---");
>       |                             ^~
> /usr/include/curses.h:442:16: note: forward declaration of ‘WINDOW’ {aka 
> ‘struct _win_st’}
>   442 | typedef struct _win_st WINDOW;
>       |                ^~~~~~~
> ../../../src/debug/debug_gui.cpp:151:30: error: invalid use of incomplete 
> type ‘WINDOW’ {aka ‘struct _win_st’}
>   151 |         mvaddstr(dbg.win_data->_begy-1,0,"---(Data Overview   Scroll: 
> page up/down)---");
>       |                              ^~
> /usr/include/curses.h:442:16: note: forward declaration of ‘WINDOW’ {aka 
> ‘struct _win_st’}
>   442 | typedef struct _win_st WINDOW;
>       |                ^~~~~~~
> ../../../src/debug/debug_gui.cpp:153:30: error: invalid use of incomplete 
> type ‘WINDOW’ {aka ‘struct _win_st’}
>   153 |         mvaddstr(dbg.win_code->_begy-1,0,"---(Code Overview   Scroll: 
> up/down     )---");
>       |                              ^~
> /usr/include/curses.h:442:16: note: forward declaration of ‘WINDOW’ {aka 
> ‘struct _win_st’}
>   442 | typedef struct _win_st WINDOW;
>       |                ^~~~~~~
> ../../../src/debug/debug_gui.cpp:155:29: error: invalid use of incomplete 
> type ‘WINDOW’ {aka ‘struct _win_st’}
>   155 |         mvaddstr(dbg.win_var->_begy-1,0, "---(Variable Overview       
>             )---");
>       |                             ^~
> /usr/include/curses.h:442:16: note: forward declaration of ‘WINDOW’ {aka 
> ‘struct _win_st’}
>   442 | typedef struct _win_st WINDOW;
>       |                ^~~~~~~
> ../../../src/debug/debug_gui.cpp:157:29: error: invalid use of incomplete 
> type ‘WINDOW’ {aka ‘struct _win_st’}
>   157 |         mvaddstr(dbg.win_out->_begy-1,0, "---(OutPut/Input    Scroll: 
> home/end    )---");
>       |                             ^~
> /usr/include/curses.h:442:16: note: forward declaration of ‘WINDOW’ {aka 
> ‘struct _win_st’}
>   442 | typedef struct _win_st WINDOW;
>       |                ^~~~~~~
> make[5]: *** [Makefile:358: debug_gui.o] Error 1

I have left out the gazillion of string format warnings, the above
messages are the only actual errors making the build fail.

They have been caused by a recent change in ncurses which makes the
WINDOW structure opaque.  Accessing its members directly is no longer
possible, you need to use library functions to obtain window dimensions
and positions.  In the current case, this would be getbegy(), see the
attached patch.  I have only tested that it builds, though,

See the ncurses INSTALL file:

,----
|     --enable-opaque-curses
|     --enable-opaque-form
|     --enable-opaque-menu
|     --enable-opaque-panel
|       Define symbol in curses.h controlling whether some library structures
|       are opaque, meaning that their members are accessible only via the
|       documented API.  The --enable-opaque-curses option may be overridden
|       by the --enable-reentrant option.
| 
|       Enabling opaque-curses enables opaque for the form, menu, and panel
|       libraries.  Use their corresponding options to disable the feature
|       individually.
| 
|       NOTE: beginning with ncurses 6.5 this option is enabled by default;
|       older versions disable it by default.
`----

While ncurses 6.5 has not been released yet, the change has already been
made in the patchlevel Debian is shipping.  From the NEWS file:

,----
| 20231021
|       + change defaults for configure opaque and widec options (prompted by
|         discussion with Branden Robinson).
`----

Cheers,
       Sven (ncurses maintainer in Debian)

From ab9fe80d94d35d10109ee4899de7b37eeab474eb Mon Sep 17 00:00:00 2001
From: Sven Joachim <svenj...@gmx.de>
Date: Wed, 6 Dec 2023 17:49:05 +0100
Subject: [PATCH] Use getbegy() rather than accessing window structures
 directly

---
 src/debug/debug_gui.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/debug/debug_gui.cpp b/src/debug/debug_gui.cpp
index fc9f1ca..53743e3 100644
--- a/src/debug/debug_gui.cpp
+++ b/src/debug/debug_gui.cpp
@@ -146,15 +146,15 @@ static void DrawBars(void) {
 		attrset(COLOR_PAIR(PAIR_BLACK_BLUE));
 	}
 	/* Show the Register bar */
-	mvaddstr(dbg.win_reg->_begy-1,0, "---(Register Overview                   )---");
+	mvaddstr(getbegy(dbg.win_reg)-1,0, "---(Register Overview                   )---");
 	/* Show the Data Overview bar perhaps with more special stuff in the end */
-	mvaddstr(dbg.win_data->_begy-1,0,"---(Data Overview   Scroll: page up/down)---");
+	mvaddstr(getbegy(dbg.win_data)-1,0,"---(Data Overview   Scroll: page up/down)---");
 	/* Show the Code Overview perhaps with special stuff in bar too */
-	mvaddstr(dbg.win_code->_begy-1,0,"---(Code Overview   Scroll: up/down     )---");
+	mvaddstr(getbegy(dbg.win_code)-1,0,"---(Code Overview   Scroll: up/down     )---");
 	/* Show the Variable Overview bar */
-	mvaddstr(dbg.win_var->_begy-1,0, "---(Variable Overview                   )---");
+	mvaddstr(getbegy(dbg.win_var)-1,0, "---(Variable Overview                   )---");
 	/* Show the Output OverView */
-	mvaddstr(dbg.win_out->_begy-1,0, "---(OutPut/Input    Scroll: home/end    )---");
+	mvaddstr(getbegy(dbg.win_out)-1,0, "---(OutPut/Input    Scroll: home/end    )---");
 	attrset(0);
 }

--
2.43.0

Reply via email to