]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #4051: Prevent conflict of UNICODE macros in cPickle.
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 2 Jan 2009 20:40:14 +0000 (20:40 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 2 Jan 2009 20:40:14 +0000 (20:40 +0000)
Misc/NEWS
Modules/cPickle.c

index 6fed1bc680798041a32e2f79d8a44f4f0c150a3a..f2865619f3c705bef71a46d1a4a0b2ce53ead9e5 100644 (file)
--- 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.
index 18baee1c395f3e129519dabbe6b8000d87cf47b3..7f836c31269b3d04ecf8a8e435db2ec070d9cffd 100644 (file)
@@ -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.