[PATCH] Fix compilation with ncurses-devel-6.1
gniibe at fsij.org
Mon Jan 20 09:10:12 CET 2020
Andre Heinecke wrote:
> On Tuesday 14 January 2020 06:03:58 CET NIIBE Yutaka wrote:
>> I haven't had any experience with Ncurses 6.1, thus, I checked the
>> possible cause.
>> I realized that when Ncurses is built with --enable-reentrant, the
>> symbol "ttytype" will be a macro (to access per thread variable), which
>> conflicts the use case of pinentry's "ttytype", as a member in a struct.
> thanks NIIBE, what do you think, should we just apply the patch? I was not so
> happy to just have an #undef in a header because depending on where you
> include it it might break other things.
Currently, #undef-ing seems an easy choice for pinentry. If we want
something Right, we'd open a can of worms.
The best thing is that Ncurses will/would eventually offer a good
API/ABI with the use case of --enable-reentrant (in future). Then, the
users of Ncurses can keep existing code with no change. But it seems
difficult, because it will once again break the ABI.
Technically, it can be cleanly implemented with thread local variables
(of C11), but Ncurses already uses macros and functions to achieve that.
More information about the Gnupg-devel