summaryrefslogtreecommitdiffstats
path: root/Include/pyport.h
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-09-06 18:58:01 (GMT)
committerBenjamin Peterson <benjamin@python.org>2016-09-06 18:58:01 (GMT)
commit4fe55106d1bd99015b18118bf1067a1189e070ea (patch)
treef45f9460a346d3f25713d5fc6ccc0fd825521f56 /Include/pyport.h
parent39093e9e6836b98dc67979e4e888e4bc639caa07 (diff)
downloadcpython-4fe55106d1bd99015b18118bf1067a1189e070ea.zip
cpython-4fe55106d1bd99015b18118bf1067a1189e070ea.tar.gz
cpython-4fe55106d1bd99015b18118bf1067a1189e070ea.tar.bz2
require standard int types to be defined (#17884)
Diffstat (limited to 'Include/pyport.h')
-rw-r--r--Include/pyport.h52
1 files changed, 1 insertions, 51 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 3d5233e..d995f3f 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -5,13 +5,8 @@
/* Some versions of HP-UX & Solaris need inttypes.h for int32_t,
INT32_MAX, etc. */
-#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
-#endif
-
-#ifdef HAVE_STDINT_H
#include <stdint.h>
-#endif
/**************************************************************************
Symbols and macros to supply platform-independent interfaces to basic
@@ -74,64 +69,19 @@ Used in: Py_uintptr_t
#endif /* LLONG_MAX */
#endif
-/* a build with 30-bit digits for Python integers needs an exact-width
- * 32-bit unsigned integer type to store those digits. (We could just use
- * type 'unsigned long', but that would be wasteful on a system where longs
- * are 64-bits.) On Unix systems, the autoconf macro AC_TYPE_UINT32_T defines
- * 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.
- */
-#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
-
-/* Macros for a 64-bit unsigned integer type; used for type 'twodigits' in the
- * integer implementation, when 30-bit digits are enabled.
- */
-#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 */
-#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
-
-#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
/* If PYLONG_BITS_IN_DIGIT is not defined then we'll use 30-bit digits if all
the necessary integer types are available, and we're on a 64-bit platform
(as determined by SIZEOF_VOID_P); otherwise we use 15-bit digits. */
#ifndef PYLONG_BITS_IN_DIGIT
-#if (defined HAVE_UINT64_T && defined HAVE_INT64_T && \
- defined HAVE_UINT32_T && defined HAVE_INT32_T && SIZEOF_VOID_P >= 8)
+#if SIZEOF_VOID_P >= 8
#define PYLONG_BITS_IN_DIGIT 30
#else
#define PYLONG_BITS_IN_DIGIT 15