summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorDaniel Stutzbach <daniel@stutzbachenterprises.com>2010-08-24 21:57:33 (GMT)
committerDaniel Stutzbach <daniel@stutzbachenterprises.com>2010-08-24 21:57:33 (GMT)
commit8515eaefda6348a72464805ff8d07041d16ab97d (patch)
tree90ccc8d24e71d167bf85a7bd2abfaf8dc29f1d8a /Objects/unicodeobject.c
parent16925e8539a39bf5599514d1be3f3c601bbc7b00 (diff)
downloadcpython-8515eaefda6348a72464805ff8d07041d16ab97d.zip
cpython-8515eaefda6348a72464805ff8d07041d16ab97d.tar.gz
cpython-8515eaefda6348a72464805ff8d07041d16ab97d.tar.bz2
Issue 8781: On systems a signed 4-byte wchar_t and a 4-byte Py_UNICODE, use memcpy to convert between the two (as already done when wchar_t is unsigned)
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index c50f601..4c4b43c 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -664,7 +664,7 @@ PyObject *PyUnicode_FromWideChar(register const wchar_t *w,
return NULL;
/* Copy the wchar_t data into the new object */
-#ifdef HAVE_USABLE_WCHAR_T
+#if Py_UNICODE_SIZE == SIZEOF_WCHAR_T
memcpy(unicode->str, w, size * sizeof(wchar_t));
#else
{
@@ -1167,7 +1167,7 @@ Py_ssize_t PyUnicode_AsWideChar(PyUnicodeObject *unicode,
if (size > PyUnicode_GET_SIZE(unicode))
size = PyUnicode_GET_SIZE(unicode) + 1;
-#ifdef HAVE_USABLE_WCHAR_T
+#if Py_UNICODE_SIZE == SIZEOF_WCHAR_T
memcpy(w, unicode->str, size * sizeof(wchar_t));
#else
{