FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.15] gh-152502: Detect optional curses functions with configure probes (GH-152504) by serhiy-storchaka · Pull Request #152589 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ac  (1) .c  (1) .h  (1) .in  (1) .rst  (1) No extension  (1) All 6 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The :mod:`curses` module now detects ``set_escdelay()``, ``set_tabsize()`` and
the ``ESCDELAY`` and ``TABSIZE`` variables with :program:`configure` capability
probes instead of the ncurses-specific ``NCURSES_EXT_FUNCS`` macro, so they are
exposed when building against other curses implementations such as NetBSD curses
that provide them.
16 changes: 10 additions & 6 deletions Modules/_cursesmodule.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4027,9 +4027,7 @@ _curses_setupterm_impl(PyObject *module, const char *term, int fd)
Py_RETURN_NONE;
}

#if defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102
// https://invisible-island.net/ncurses/NEWS.html#index-t20080119

#ifdef HAVE_CURSES_ESCDELAY
/*[clinic input]
_curses.get_escdelay

Expand All @@ -4046,6 +4044,9 @@ _curses_get_escdelay_impl(PyObject *module)
{
return PyLong_FromLong(ESCDELAY);
}
#endif /* HAVE_CURSES_ESCDELAY */

#ifdef HAVE_CURSES_SET_ESCDELAY
/*[clinic input]
_curses.set_escdelay
ms: int
Expand All @@ -4070,7 +4071,9 @@ _curses_set_escdelay_impl(PyObject *module, int ms)

return curses_check_err(module, set_escdelay(ms), "set_escdelay", NULL);
}
#endif /* HAVE_CURSES_SET_ESCDELAY */

#ifdef HAVE_CURSES_TABSIZE
/*[clinic input]
_curses.get_tabsize

Expand All @@ -4086,6 +4089,9 @@ _curses_get_tabsize_impl(PyObject *module)
{
return PyLong_FromLong(TABSIZE);
}
#endif /* HAVE_CURSES_TABSIZE */

#ifdef HAVE_CURSES_SET_TABSIZE
/*[clinic input]
_curses.set_tabsize
size: int
Expand All @@ -4109,7 +4115,7 @@ _curses_set_tabsize_impl(PyObject *module, int size)

return curses_check_err(module, set_tabsize(size), "set_tabsize", NULL);
}
#endif
#endif /* HAVE_CURSES_SET_TABSIZE */

/*[clinic input]
_curses.intrflush
Expand Down Expand Up @@ -5372,10 +5378,8 @@ static PyMethodDef cursesmodule_methods[] = {
_CURSES_RESIZETERM_METHODDEF
_CURSES_RESIZE_TERM_METHODDEF
_CURSES_SAVETTY_METHODDEF
#if defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102
_CURSES_GET_ESCDELAY_METHODDEF
_CURSES_SET_ESCDELAY_METHODDEF
#endif
_CURSES_GET_TABSIZE_METHODDEF
_CURSES_SET_TABSIZE_METHODDEF
_CURSES_SETSYX_METHODDEF
Expand Down
18 changes: 9 additions & 9 deletions Modules/clinic/_cursesmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

238 changes: 238 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading

Back | FazBrowse Home | New Git URL