diff mercurial/cext/charencode.c @ 33812:4ba863c88135

cext: move PyInt macros to charencode.c properly Python3 build was broken at e9996bd7203f.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 14 Aug 2017 13:35:26 +0900
parents a22339d389d4
children 2c37f9dabc32
line wrap: on
line diff
--- a/mercurial/cext/charencode.c	Mon Aug 14 15:50:40 2017 +0900
+++ b/mercurial/cext/charencode.c	Mon Aug 14 13:35:26 2017 +0900
@@ -13,6 +13,14 @@
 #include "charencode.h"
 #include "util.h"
 
+#ifdef IS_PY3K
+/* The mapping of Python types is meant to be temporary to get Python
+ * 3 to compile. We should remove this once Python 3 support is fully
+ * supported and proper types are used in the extensions themselves. */
+#define PyInt_Type PyLong_Type
+#define PyInt_AS_LONG PyLong_AS_LONG
+#endif
+
 static const char lowertable[128] = {
 	'\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
 	'\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',