summaryrefslogtreecommitdiffstats
path: root/Include/unicodeobject.h
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2000-07-07 09:01:41 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2000-07-07 09:01:41 (GMT)
commit43279100f4b0dda7f2f444ae09d22a71ec2c5183 (patch)
tree33f96e4caa143f26dfb158479c457f0c9639efce /Include/unicodeobject.h
parente4dbb86ab85113c1433434ff3cc0f80401690daf (diff)
downloadcpython-43279100f4b0dda7f2f444ae09d22a71ec2c5183.zip
cpython-43279100f4b0dda7f2f444ae09d22a71ec2c5183.tar.gz
cpython-43279100f4b0dda7f2f444ae09d22a71ec2c5183.tar.bz2
Bill Tutt: Added Py_UCS4 typedef to hold UCS4 values (these need
at least 32 bits as opposed to Py_UNICODE which rely on having 16 bits).
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r--Include/unicodeobject.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 74cb033..b9840dd 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -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