summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMasayuki Yamamoto <ma3yuki.8mamo10@gmail.com>2017-11-01 21:05:26 +0900
committerSerhiy Storchaka <storchaka@gmail.com>2017-11-01 14:05:26 +0200
commit8bc7d63560024681dce9f40445f2877b2987e92c (patch)
treeb1e05ed1a68b1d8b0f3d7a5268c11922084dc29f /configure
parent280c22a82a6756e9caffef031c564fd98f1b50e7 (diff)
downloadcpython-git-8bc7d63560024681dce9f40445f2877b2987e92c.tar.gz
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().
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure39
1 files changed, 38 insertions, 1 deletions
diff --git a/configure b/configure
index bb7cc51407..00cfd64a2b 100755
--- a/configure
+++ b/configure
@@ -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