]> granicus.if.org Git - python/commitdiff
needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C
authorFredrik Lundh <fredrik@pythonware.com>
Thu, 25 May 2006 16:10:12 +0000 (16:10 +0000)
committerFredrik Lundh <fredrik@pythonware.com>
Thu, 25 May 2006 16:10:12 +0000 (16:10 +0000)
versions if they're not defined.

Objects/stringobject.c

index 3ec45243d23c8019b18f7112536a5a02bf7550f2..7bddeaa99ea12fb4e7bae0d1b346a0aa81a37a32 100644 (file)
@@ -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)
 {