Re: [PATCH 20/24] Allow TUI windows in Python

Tom Tromey
2020-03-11T18:05:53Z

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> This file tells us Python was built with ncurses, which doesn't mean the
Simon> ncurses development headers are installed and available to GDB. I find it
Simon> very odd that Python exposes these very generically-named macros in the global
Simon> namespace. Almost any of these HAVE_FOO macros from Python could clash with
Simon> our own macros.

Yes, it's a bad practice. Unfortunately autoconf never really provided
an easy-enough way to do the right thing here, so I think plenty of
packages have bad hygiene this way.

Simon> One way to fix it is to make sure "python-internal.h" is included after
Simon> "gdb_curses.h", in py-tui.c.

Feel free to put that in, I guess with a comment.

Another option might be to check whether HAVE_NCURSES_H is undefined
before including the Python headers, but defined afterward and #error in
this case. That way we could perhaps give a less confusing error
message.

Tom