summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-20 17:28:29 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-20 17:28:29 (GMT)
commit7c8bbbbb0c24350eca5e8bfb8223d3f01c90646c (patch)
tree61f88f5d8886d7436c03b6f8ef1ed99cc83d07a5
parent46606ce870588f7c7606cfcaa0ed192dd30aba17 (diff)
downloadcpython-7c8bbbbb0c24350eca5e8bfb8223d3f01c90646c.zip
cpython-7c8bbbbb0c24350eca5e8bfb8223d3f01c90646c.tar.gz
cpython-7c8bbbbb0c24350eca5e8bfb8223d3f01c90646c.tar.bz2
Ensure that Py_UCS4 is 32 bits and Py_UCS2 is 16 bits
-rw-r--r--Include/unicodeobject.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 88bb7c8..2323c65 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -117,15 +117,20 @@ typedef wchar_t Py_UNICODE;
/* Py_UCS4 and Py_UCS2 are typedefs for the respective
unicode representations. */
-#if SIZEOF_INT >= 4
+#if SIZEOF_INT == 4
typedef unsigned int Py_UCS4;
-#elif SIZEOF_LONG >= 4
+#elif SIZEOF_LONG == 4
typedef unsigned long Py_UCS4;
#else
#error "Could not find a proper typedef for Py_UCS4"
#endif
+#if SIZEOF_SHORT == 2
typedef unsigned short Py_UCS2;
+#else
+#error "Could not find a proper typedef for Py_UCS2"
+#endif
+
typedef unsigned char Py_UCS1;
/* --- Internal Unicode Operations ---------------------------------------- */