bpo-25720: Fix the method for checking pad state of curses WINDOW (#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().
This commit is contained in:
Masayuki Yamamoto 2017-11-01 21:05:26 +09:00 committed by Serhiy Storchaka
parent 280c22a82a
commit 8bc7d63560
6 changed files with 90 additions and 17 deletions

39
configure vendored
View file

@ -15699,6 +15699,10 @@ $as_echo "#define MVWDELCH_IS_EXPRESSION 1" >>confdefs.h
fi
# Issue #25720: ncurses has introduced the NCURSES_OPAQUE symbol making opaque
# structs since version 5.7. If the macro is defined as zero before including
# [n]curses.h, ncurses will expose fields of the structs regardless of the
# configuration.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags" >&5
$as_echo_n "checking whether WINDOW has _flags... " >&6; }
if ${ac_cv_window_has_flags+:} false; then :
@ -15706,7 +15710,10 @@ if ${ac_cv_window_has_flags+:} false; then :
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <curses.h>
#define NCURSES_OPAQUE 0
#include <curses.h>
int
main ()
{
@ -15737,6 +15744,36 @@ $as_echo "#define WINDOW_HAS_FLAGS 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_pad" >&5
$as_echo_n "checking for is_pad... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <curses.h>
int
main ()
{
#ifndef is_pad
void *x=is_pad
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
$as_echo "#define HAVE_CURSES_IS_PAD 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_term_resized" >&5
$as_echo_n "checking for is_term_resized... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext