summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2017-11-01 05:36:48 -0700
committerSerhiy Storchaka <storchaka@gmail.com>2017-11-01 14:36:48 +0200
commit6ba0b583d6785a256b17d27431908d67015eeeb6 (patch)
treef07b33336d954ec3ae75be4bb826411d72762026 /configure.ac
parente7531e54bf195b8d3ed35b4138901c82f7ed794c (diff)
downloadcpython-git-6ba0b583d6785a256b17d27431908d67015eeeb6.tar.gz
bpo-25720: Fix the method for checking pad state of curses WINDOW (GH-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 8bc7d63560024681dce9f40445f2877b2987e92c)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 19 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 2cc23cc32f..f6ee87c53f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4516,9 +4516,16 @@ then
[Define if mvwdelch in curses.h is an expression.])
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.
AC_MSG_CHECKING(whether WINDOW has _flags)
AC_CACHE_VAL(ac_cv_window_has_flags,
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #define NCURSES_OPAQUE 0
+ #include <curses.h>
+]], [[
WINDOW *w;
w->_flags = 0;
]])],
@@ -4533,6 +4540,17 @@ then
[Define if WINDOW in curses.h offers a field _flags.])
fi
+AC_MSG_CHECKING(for is_pad)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[
+#ifndef is_pad
+void *x=is_pad
+#endif
+]])],
+ [AC_DEFINE(HAVE_CURSES_IS_PAD, 1, Define if you have the 'is_pad' function or macro.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)]
+)
+
AC_MSG_CHECKING(for is_term_resized)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=is_term_resized]])],
[AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_resized' function.)