From: Amaury Forgeot d'Arc Date: Tue, 14 Oct 2008 22:00:06 +0000 (+0000) Subject: Merged revisions 66891 via svnmerge from X-Git-Tag: v2.6.1~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38e46fc628f023750e90f727c918ab5fedc37b33;p=python Merged revisions 66891 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r66891 | amaury.forgeotdarc | 2008-10-14 23:47:22 +0200 (mar., 14 oct. 2008) | 5 lines #4122: On Windows, Py_UNICODE_ISSPACE cannot be used in an extension module: compilation fails with "undefined reference to _Py_ascii_whitespace" Will backport to 2.6. ........ --- diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 057f770539..ee9fec16fe 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -354,7 +354,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE; in most situations is solely ASCII whitespace, we optimize for the common case by using a quick look-up table with an inlined check. */ -extern const unsigned char _Py_ascii_whitespace[]; +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; #define Py_UNICODE_ISSPACE(ch) \ ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) diff --git a/Misc/NEWS b/Misc/NEWS index f0bcb70f2b..7cae02dd96 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -37,6 +37,12 @@ Build - Issue #3758: Add ``patchcheck`` build target to .PHONY. +C-API +----- + +- Issue #4122: On Windows, fix a compilation error when using the + Py_UNICODE_ISSPACE macro in an extension module. + What's New in Python 2.6 final ============================== diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index f3a9f5ce9d..adb04c0bb8 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -484,6 +484,10 @@ test_u_code(PyObject *self) Py_UNICODE *value; int len; + /* issue4122: Undefined reference to _Py_ascii_whitespace on Windows */ + /* Just use the macro and check that it compiles */ + int x = Py_UNICODE_ISSPACE(25); + tuple = PyTuple_New(1); if (tuple == NULL) return NULL;