mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C
versions if they're not defined.
This commit is contained in:
parent
f94323fbb4
commit
dfe503d3f0
1 changed files with 9 additions and 0 deletions
|
|
@ -2033,6 +2033,11 @@ PyDoc_STRVAR(lower__doc__,
|
|||
\n\
|
||||
Return a copy of the string S converted to lowercase.");
|
||||
|
||||
/* _tolower and _toupper are defined by SUSv2, but they're not ISO C */
|
||||
#ifndef _tolower
|
||||
#define _tolower tolower
|
||||
#endif
|
||||
|
||||
static PyObject *
|
||||
string_lower(PyStringObject *self)
|
||||
{
|
||||
|
|
@ -2062,6 +2067,10 @@ PyDoc_STRVAR(upper__doc__,
|
|||
\n\
|
||||
Return a copy of the string S converted to uppercase.");
|
||||
|
||||
#ifndef _toupper
|
||||
#define _toupper toupper
|
||||
#endif
|
||||
|
||||
static PyObject *
|
||||
string_upper(PyStringObject *self)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue