New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-25720: Fix the method for checking pad state of curses WINDOW #4164
Conversation
Modify the code to use ncurses is_pad() instead of checking WINDOW _flags field. If your platform does not provide the is_pad(), the existing way that checks the field will be enabled. Note: This change does not drop support for platforms where do not have both WINDOW _flags field and is_pad().
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
@serhiy-storchaka I see |
Thanks for making the requested changes! @serhiy-storchaka: please review the changes made to this pull request. |
Thanks @ma8ma for the PR, and @serhiy-storchaka for merging it |
…thonGH-4164) Modify the code to use ncurses is_pad() instead of checking WINDOW _flags field. If your platform does not provide the is_pad(), the existing way that checks the field will be enabled. Note: This change does not drop support for platforms where do not have both WINDOW _flags field and is_pad(). (cherry picked from commit 8bc7d63)
GH-4212 is a backport of this pull request to the 3.6 branch. |
…thonGH-4164) Modify the code to use ncurses is_pad() instead of checking WINDOW _flags field. If your platform does not provide the is_pad(), the existing way that checks the field will be enabled. Note: This change does not drop support for platforms where do not have both WINDOW _flags field and is_pad(). (cherry picked from commit 8bc7d63)
GH-4213 is a backport of this pull request to the 2.7 branch. |
…-4164) (#4212) Modify the code to use ncurses is_pad() instead of checking WINDOW _flags field. If your platform does not provide the is_pad(), the existing way that checks the field will be enabled. Note: This change does not drop support for platforms where do not have both WINDOW _flags field and is_pad(). (cherry picked from commit 8bc7d63)
…-4164) (#4213) Modify the code to use ncurses is_pad() instead of checking WINDOW _flags field. If your platform does not provide the is_pad(), the existing way that checks the field will be enabled. Note: This change does not drop support for platforms where do not have both WINDOW _flags field and is_pad(). (cherry picked from commit 8bc7d63)
@serhiy-storchaka Thank you for merging! |
…thon#4164) Modify the code to use ncurses is_pad() instead of checking WINDOW _flags field. If your platform does not provide the is_pad(), the existing way that checks the field will be enabled. Note: This change does not drop support for platforms where do not have both WINDOW _flags field and is_pad().
Highlights of changes
_flags
field.is_pad
function/macro.NCURSES_OPAQUE
for Apple-specific.NCURSES_OPAQUE
as zero in the case of nois_pad()
and having WINDOW_flags
.WINDOW_HAS_FLAGS
when having ncurses.h.HAVE_CURSES_IS_PAD
when having ncurses.h.py_is_pad()
macro ifHAVE_CURSES_IS_PAD
orWINDOW_HAS_FLAGS
are defined.WINDOW_HAS_FLAGS
withpy_is_pad
.Motivation
WINDOW_HAS_FLAGS
will be defined by configure check, but if your platform has ncurses.h, defines the macro always. Therefore, codes which check the WINDOW_flags
field are enabled regardless ofNCURSES_OPAQUE
(added since ncurses 5.7), and a compile error occurs on platforms where WINDOW is actually opaque.For this reason, these codes are modified to use ncurses
is_pad()
instead of checking the field. If your platform does not provide theis_pad()
(added since ncurses 5.8 as a ncurses-specific feature), the existing way that checks the field will be enabled. In this case,NCURSES_OPAQUE
is defined as zero before including [n]curses.h, for exposing WINDOW fields regardless of the configuraton.Note: This change does not drop support for platforms where do not have both WINDOW
_flags
field andis_pad()
.https://bugs.python.org/issue25720