summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-03-20 15:51:55 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-03-20 15:51:55 (GMT)
commitefc82f7e8eff19d8e844a3dc268a88de7fbcb173 (patch)
tree58198f2e7610ba6d33865884487de006de30af85 /PC
parentc8e81ef508f0f1dc4e5c31bd0bec2766867fead5 (diff)
downloadcpython-efc82f7e8eff19d8e844a3dc268a88de7fbcb173.zip
cpython-efc82f7e8eff19d8e844a3dc268a88de7fbcb173.tar.gz
cpython-efc82f7e8eff19d8e844a3dc268a88de7fbcb173.tar.bz2
Issue #4258: Use 30-bit digits for Python longs, on 64-bit platforms.
Backport of r70459.
Diffstat (limited to 'PC')
-rw-r--r--PC/pyconfig.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index 3719586..77f80a8 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -400,6 +400,42 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
#endif
+/* define signed and unsigned exact-width 32-bit and 64-bit types, used in the
+ implementation of Python long integers. */
+#ifndef PY_UINT32_T
+#if SIZEOF_INT == 4
+#define HAVE_UINT32_T 1
+#define PY_UINT32_T unsigned int
+#elif SIZEOF_LONG == 4
+#define HAVE_UINT32_T 1
+#define PY_UINT32_T unsigned long
+#endif
+#endif
+
+#ifndef PY_UINT64_T
+#if SIZEOF_LONG_LONG == 8
+#define HAVE_UINT64_T 1
+#define PY_UINT64_T unsigned PY_LONG_LONG
+#endif
+#endif
+
+#ifndef PY_INT32_T
+#if SIZEOF_INT == 4
+#define HAVE_INT32_T 1
+#define PY_INT32_T int
+#elif SIZEOF_LONG == 4
+#define HAVE_INT32_T 1
+#define PY_INT32_T long
+#endif
+#endif
+
+#ifndef PY_INT64_T
+#if SIZEOF_LONG_LONG == 8
+#define HAVE_INT64_T 1
+#define PY_INT64_T PY_LONG_LONG
+#endif
+#endif
+
/* Fairly standard from here! */
/* Define to 1 if you have the `copysign' function. */