summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2006-05-25 16:10:12 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2006-05-25 16:10:12 (GMT)
commitdfe503d3f09b9030328bab8d34457ddf14025e1f (patch)
tree2ebe1fdef48a30e6247e27c53fb1dc62ff3d2a80 /Objects
parentf94323fbb4e83b756b1f328f06a1615d8c366c20 (diff)
downloadcpython-dfe503d3f09b9030328bab8d34457ddf14025e1f.zip
cpython-dfe503d3f09b9030328bab8d34457ddf14025e1f.tar.gz
cpython-dfe503d3f09b9030328bab8d34457ddf14025e1f.tar.bz2
needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C
versions if they're not defined.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/stringobject.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 3ec4524..7bddeaa 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -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)
{