summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2012-12-02 13:13:56 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2012-12-02 13:13:56 (GMT)
commit17c50cdac2c35e4f37bc5fd68f24a00d1e7c67a6 (patch)
treeb3edc20f58e9593f51d297facf6abc90ca9e27b4 /Include
parentb83575b0a5a798301a85a602a8d888329da0cf88 (diff)
downloadcpython-17c50cdac2c35e4f37bc5fd68f24a00d1e7c67a6.zip
cpython-17c50cdac2c35e4f37bc5fd68f24a00d1e7c67a6.tar.gz
cpython-17c50cdac2c35e4f37bc5fd68f24a00d1e7c67a6.tar.bz2
Issue 10052: fix failed uint32_t / uint64_t / int32_t / int64_t detection on some platforms.
Diffstat (limited to 'Include')
-rw-r--r--Include/pyport.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 899d3d0..85e852f 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -93,9 +93,12 @@ Used in: PY_LONG_LONG
* uint32_t to be such a type unless stdint.h or inttypes.h defines uint32_t.
* However, it doesn't set HAVE_UINT32_T, so we do that here.
*/
-#if (defined UINT32_MAX || defined uint32_t)
-#ifndef PY_UINT32_T
+#ifdef uint32_t
#define HAVE_UINT32_T 1
+#endif
+
+#ifdef HAVE_UINT32_T
+#ifndef PY_UINT32_T
#define PY_UINT32_T uint32_t
#endif
#endif
@@ -103,23 +106,33 @@ Used in: PY_LONG_LONG
/* Macros for a 64-bit unsigned integer type; used for type 'twodigits' in the
* long integer implementation, when 30-bit digits are enabled.
*/
-#if (defined UINT64_MAX || defined uint64_t)
-#ifndef PY_UINT64_T
+#ifdef uint64_t
#define HAVE_UINT64_T 1
+#endif
+
+#ifdef HAVE_UINT64_T
+#ifndef PY_UINT64_T
#define PY_UINT64_T uint64_t
#endif
#endif
/* Signed variants of the above */
-#if (defined INT32_MAX || defined int32_t)
-#ifndef PY_INT32_T
+#ifdef int32_t
#define HAVE_INT32_T 1
+#endif
+
+#ifdef HAVE_INT32_T
+#ifndef PY_INT32_T
#define PY_INT32_T int32_t
#endif
#endif
-#if (defined INT64_MAX || defined int64_t)
-#ifndef PY_INT64_T
+
+#ifdef int64_t
#define HAVE_INT64_T 1
+#endif
+
+#ifdef HAVE_INT64_T
+#ifndef PY_INT64_T
#define PY_INT64_T int64_t
#endif
#endif