From 296cebae46e8de2d3e126062c91486329d5fa889 Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Thu, 9 Sep 2021 09:29:04 -0700 Subject: [PATCH 1/5] issue45067 - Fix _curses compilation in CentOS 7. Verify the version of ncurses for extended color support feature usage. The function extended_color_content was introduced in 2017. The ncurses-devel package in CentOS 7 had a older version ncurses resulted in compilation error. For compiling ncurses with extended color support, we verify the version of the ncurses library. --- Modules/_cursesmodule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 61aaf855229f862..7c9a38d569e8035 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -135,7 +135,8 @@ typedef chtype attr_t; /* No attr_t type is available */ #define STRICT_SYSV_CURSES #endif -#if NCURSES_EXT_COLORS+0 && NCURSES_EXT_FUNCS+0 +#if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20170401) && \ + (defined(NCURSES_EXT_COLORS) && NCURSES_EXT_COLORS >= 20170401) #define _NCURSES_EXTENDED_COLOR_FUNCS 1 #else #define _NCURSES_EXTENDED_COLOR_FUNCS 0 From fa0d550aa7e74d06ece384370b27e5554a9dc04e Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Thu, 9 Sep 2021 16:45:28 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst diff --git a/Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst b/Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst new file mode 100644 index 000000000000000..51777a87bbe73a1 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst @@ -0,0 +1,2 @@ +The ncurses function `extended_color_content` was introduced in 2017. +https://invisible-island.net/ncurses/NEWS.html#index-t20170401) The ncurses-devel package in CentOS 7 had a older version ncurses resulted in compilation error. For compiling ncurses with extended color support, we verify the version of the ncurses library >= 20170401. \ No newline at end of file From 17f1f39a73b3ff878eec024c20e6e1ea3dbef66f Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Thu, 9 Sep 2021 10:52:30 -0700 Subject: [PATCH 3/5] Update Modules/_cursesmodule.c Co-authored-by: Serhiy Storchaka --- Modules/_cursesmodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 7c9a38d569e8035..d3189dab06d4394 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -135,8 +135,7 @@ typedef chtype attr_t; /* No attr_t type is available */ #define STRICT_SYSV_CURSES #endif -#if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20170401) && \ - (defined(NCURSES_EXT_COLORS) && NCURSES_EXT_COLORS >= 20170401) +#if NCURSES_EXT_FUNCS+0 >= 20170401 && NCURSES_EXT_COLORS+0 >= 20170401 #define _NCURSES_EXTENDED_COLOR_FUNCS 1 #else #define _NCURSES_EXTENDED_COLOR_FUNCS 0 From d4285abcf32283a042d7e25857f55a93f779e21b Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Thu, 9 Sep 2021 10:54:00 -0700 Subject: [PATCH 4/5] Removed the non-matching comment. --- Modules/_cursesmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index d3189dab06d4394..511073f2ac13799 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -139,7 +139,7 @@ typedef chtype attr_t; /* No attr_t type is available */ #define _NCURSES_EXTENDED_COLOR_FUNCS 1 #else #define _NCURSES_EXTENDED_COLOR_FUNCS 0 -#endif /* defined(NCURSES_EXT_COLORS) && defined(NCURSES_EXT_FUNCS) */ +#endif #if _NCURSES_EXTENDED_COLOR_FUNCS #define _CURSES_COLOR_VAL_TYPE int From 493fe45bab7630eaf584f7ac21f0fb1198a11513 Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Thu, 9 Sep 2021 11:08:17 -0700 Subject: [PATCH 5/5] Fix the news documentation. --- .../next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst b/Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst index 51777a87bbe73a1..b64a899bd337285 100644 --- a/Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst +++ b/Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst @@ -1,2 +1,5 @@ -The ncurses function `extended_color_content` was introduced in 2017. -https://invisible-island.net/ncurses/NEWS.html#index-t20170401) The ncurses-devel package in CentOS 7 had a older version ncurses resulted in compilation error. For compiling ncurses with extended color support, we verify the version of the ncurses library >= 20170401. \ No newline at end of file +The ncurses function extended_color_content was introduced in 2017. +https://invisible-island.net/ncurses/NEWS.html#index-t20170401) The +ncurses-devel package in CentOS 7 had a older version ncurses resulted in +compilation error. For compiling ncurses with extended color support, we +verify the version of the ncurses library >= 20170401.