From: Martin v. Löwis Date: Fri, 2 Jan 2009 20:40:14 +0000 (+0000) Subject: Issue #4051: Prevent conflict of UNICODE macros in cPickle. X-Git-Tag: v2.7a1~2418 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ac4927125d0de98b7393afc5b13cfa4e3ce75f2;p=thirdparty%2FPython%2Fcpython.git Issue #4051: Prevent conflict of UNICODE macros in cPickle. --- diff --git a/Misc/NEWS b/Misc/NEWS index 6fed1bc68079..f2865619f3c7 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -286,6 +286,8 @@ C-API Extension Modules ----------------- +- Issue #4051: Prevent conflict of UNICODE macros in cPickle. + - Issue #4228: Pack negative values the same way as 2.4 in struct's L format. - Issue #1040026: Fix os.times result on systems where HZ is incorrect. diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 18baee1c395f..7f836c31269b 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -17,6 +17,14 @@ PyDoc_STRVAR(cPickle_module_documentation, /* Bump this when new opcodes are added to the pickle protocol. */ #define HIGHEST_PROTOCOL 2 +/* + * Note: The UNICODE macro controls the TCHAR meaning of the win32 API. Since + * all headers have already been included here, we can safely redefine it. + */ +#ifdef UNICODE +# undef UNICODE +#endif + /* * Pickle opcodes. These must be kept in synch with pickle.py. Extensive * docs are in pickletools.py.