]> granicus.if.org Git - python/commitdiff
Bill Tutt: Added Py_UCS4 typedef to hold UCS4 values (these need
authorMarc-André Lemburg <mal@egenix.com>
Fri, 7 Jul 2000 09:01:41 +0000 (09:01 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Fri, 7 Jul 2000 09:01:41 +0000 (09:01 +0000)
at least 32 bits as opposed to Py_UNICODE which rely on having
16 bits).

Include/unicodeobject.h

index 74cb0334db84088517a822ca9127d765b20bd978..b9840dd4f6fb8cb7d82bf887d5ef14e659fc11d0 100644 (file)
@@ -107,6 +107,17 @@ typedef unsigned short Py_UNICODE;
 
 #endif
 
+/*
+ * Use this typedef when you need to represent a UTF-16 surrogate pair
+ * as single unsigned integer.
+ */
+#if SIZEOF_INT >= 4 
+typedef unsigned int Py_UCS4; 
+#elif SIZEOF_LONG >= 4
+typedef unsigned long Py_UCS4; 
+#endif 
+
+
 /* --- Internal Unicode Operations ---------------------------------------- */
 
 /* If you want Python to use the compiler's wctype.h functions instead