diff -r 84cef4f1999a Include/pyport.h --- a/Include/pyport.h Mon Apr 29 16:09:39 2013 -0400 +++ b/Include/pyport.h Wed May 01 00:44:52 2013 +0200 @@ -169,19 +169,6 @@ Used in: PY_LONG_LONG #ifdef HAVE_UINTPTR_T typedef uintptr_t Py_uintptr_t; typedef intptr_t Py_intptr_t; - -#elif SIZEOF_VOID_P <= SIZEOF_INT -typedef unsigned int Py_uintptr_t; -typedef int Py_intptr_t; - -#elif SIZEOF_VOID_P <= SIZEOF_LONG -typedef unsigned long Py_uintptr_t; -typedef long Py_intptr_t; - -#elif defined(HAVE_LONG_LONG) && (SIZEOF_VOID_P <= SIZEOF_LONG_LONG) -typedef unsigned PY_LONG_LONG Py_uintptr_t; -typedef PY_LONG_LONG Py_intptr_t; - #else # error "Python needs a typedef for Py_uintptr_t in pyport.h." #endif /* HAVE_UINTPTR_T */ @@ -192,8 +179,6 @@ typedef PY_LONG_LONG Py_intpt */ #ifdef HAVE_SSIZE_T typedef ssize_t Py_ssize_t; -#elif SIZEOF_VOID_P == SIZEOF_SIZE_T -typedef Py_intptr_t Py_ssize_t; #else # error "Python needs a typedef for Py_ssize_t in pyport.h." #endif diff -r 84cef4f1999a Include/unicodeobject.h --- a/Include/unicodeobject.h Mon Apr 29 16:09:39 2013 -0400 +++ b/Include/unicodeobject.h Wed May 01 00:44:52 2013 +0200 @@ -117,21 +117,9 @@ typedef wchar_t Py_UNICODE; /* Py_UCS4 and Py_UCS2 are typedefs for the respective unicode representations. */ -#if SIZEOF_INT == 4 -typedef unsigned int Py_UCS4; -#elif SIZEOF_LONG == 4 -typedef unsigned long Py_UCS4; -#else -#error "Could not find a proper typedef for Py_UCS4" -#endif - -#if SIZEOF_SHORT == 2 -typedef unsigned short Py_UCS2; -#else -#error "Could not find a proper typedef for Py_UCS2" -#endif - -typedef unsigned char Py_UCS1; +typedef uint8_t Py_UCS1; +typedef uint16_t Py_UCS2; +typedef uint32_t Py_UCS4; /* --- Internal Unicode Operations ---------------------------------------- */ diff -r 84cef4f1999a Modules/_testcapimodule.c --- a/Modules/_testcapimodule.c Mon Apr 29 16:09:39 2013 -0400 +++ b/Modules/_testcapimodule.c Wed May 01 00:44:52 2013 +0200 @@ -54,6 +54,16 @@ test_config(PyObject *self) CHECK_SIZEOF(SIZEOF_LONG, long); CHECK_SIZEOF(SIZEOF_VOID_P, void*); CHECK_SIZEOF(SIZEOF_TIME_T, time_t); + CHECK_SIZEOF(SIZEOF_INT8_T, int8_t); + CHECK_SIZEOF(SIZEOF_INT16_T, int16_t); + CHECK_SIZEOF(SIZEOF_INT32_T, int32_t); + CHECK_SIZEOF(SIZEOF_INT64_T, int64_t); + CHECK_SIZEOF(SIZEOF_UINT8_T, uint8_t); + CHECK_SIZEOF(SIZEOF_UINT16_T, uint16_t); + CHECK_SIZEOF(SIZEOF_UINT32_T, uint32_t); + CHECK_SIZEOF(SIZEOF_UINT64_T, uint64_t); + CHECK_SIZEOF(SIZEOF_UINTPTR_T, intptr_t); + CHECK_SIZEOF(SIZEOF_UINTPTR_T, uintptr_t); #ifdef HAVE_LONG_LONG CHECK_SIZEOF(SIZEOF_LONG_LONG, PY_LONG_LONG); #endif diff -r 84cef4f1999a Modules/audioop.c --- a/Modules/audioop.c Mon Apr 29 16:09:39 2013 -0400 +++ b/Modules/audioop.c Wed May 01 00:44:52 2013 +0200 @@ -5,19 +5,9 @@ #include "Python.h" -#if SIZEOF_INT == 4 -typedef int Py_Int32; -typedef unsigned int Py_UInt32; -#else -#if SIZEOF_LONG == 4 -typedef long Py_Int32; -typedef unsigned long Py_UInt32; -#else -#error "No 4-byte integral type" -#endif -#endif - -typedef short PyInt16; +typedef int16_t PyInt16; +typedef int32_t Py_Int32; +typedef uint32_t Py_UInt32; #if defined(__CHAR_UNSIGNED__) #if defined(signed) diff -r 84cef4f1999a Modules/md5module.c --- a/Modules/md5module.c Mon Apr 29 16:09:39 2013 -0400 +++ b/Modules/md5module.c Wed May 01 00:44:52 2013 +0200 @@ -22,12 +22,8 @@ /* Some useful types */ -#if SIZEOF_INT == 4 -typedef unsigned int MD5_INT32; /* 32-bit integer */ -typedef PY_LONG_LONG MD5_INT64; /* 64-bit integer */ -#else -/* not defined. compilation will die. */ -#endif +typedef uint32_t MD5_INT32; /* 32-bit integer */ +typedef uint64_t MD5_INT64; /* 64-bit integer */ /* The MD5 block size and message digest sizes, in bytes */ diff -r 84cef4f1999a Modules/sha1module.c --- a/Modules/sha1module.c Mon Apr 29 16:09:39 2013 -0400 +++ b/Modules/sha1module.c Wed May 01 00:44:52 2013 +0200 @@ -22,12 +22,8 @@ /* Some useful types */ -#if SIZEOF_INT == 4 -typedef unsigned int SHA1_INT32; /* 32-bit integer */ -typedef PY_LONG_LONG SHA1_INT64; /* 64-bit integer */ -#else -/* not defined. compilation will die. */ -#endif +typedef uint32_t SHA1_INT32; /* 32-bit integer */ +typedef uint64_t SHA1_INT64; /* 64-bit integer */ /* The SHA1 block size and message digest sizes, in bytes */ diff -r 84cef4f1999a Modules/sha256module.c --- a/Modules/sha256module.c Mon Apr 29 16:09:39 2013 -0400 +++ b/Modules/sha256module.c Wed May 01 00:44:52 2013 +0200 @@ -25,11 +25,7 @@ typedef unsigned char SHA_BYTE; -#if SIZEOF_INT == 4 -typedef unsigned int SHA_INT32; /* 32-bit integer */ -#else -/* not defined. compilation will die. */ -#endif +typedef uint32_t SHA_INT32; /* 32-bit integer */ /* The SHA block size and message digest sizes, in bytes */ diff -r 84cef4f1999a Modules/sha512module.c --- a/Modules/sha512module.c Mon Apr 29 16:09:39 2013 -0400 +++ b/Modules/sha512module.c Wed May 01 00:44:52 2013 +0200 @@ -26,12 +26,8 @@ typedef unsigned char SHA_BYTE; -#if SIZEOF_INT == 4 -typedef unsigned int SHA_INT32; /* 32-bit integer */ -typedef unsigned PY_LONG_LONG SHA_INT64; /* 64-bit integer */ -#else -/* not defined. compilation will die. */ -#endif +typedef uint32_t SHA_INT32; /* 32-bit integer */ +typedef uint64_t SHA_INT64; /* 64-bit integer */ /* The SHA block size and message digest sizes, in bytes */ diff -r 84cef4f1999a configure.ac --- a/configure.ac Mon Apr 29 16:09:39 2013 -0400 +++ b/configure.ac Wed May 01 00:44:52 2013 +0200 @@ -1646,6 +1646,7 @@ AC_TYPE_OFF_T AC_TYPE_PID_T AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is always void]) AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T AC_TYPE_UID_T # There are two separate checks for each of the exact-width integer types we @@ -1655,6 +1656,14 @@ AC_TYPE_UID_T # the form AC_TYPE_UINT32_T, which in the case that uint32_t is not available # directly, #define's uint32_t to be a suitable type. +AC_CHECK_TYPE(uint8_t, + AC_DEFINE(HAVE_UINT8_T, 1, [Define if your compiler provides uint8_t.]),,) +AC_TYPE_UINT8_T + +AC_CHECK_TYPE(uint16_t, + AC_DEFINE(HAVE_UINT16_T, 1, [Define if your compiler provides uint16_t.]),,) +AC_TYPE_UINT16_T + AC_CHECK_TYPE(uint32_t, AC_DEFINE(HAVE_UINT32_T, 1, [Define if your compiler provides uint32_t.]),,) AC_TYPE_UINT32_T @@ -1663,6 +1672,14 @@ AC_CHECK_TYPE(uint64_t, AC_DEFINE(HAVE_UINT64_T, 1, [Define if your compiler provides uint64_t.]),,) AC_TYPE_UINT64_T +AC_CHECK_TYPE(int8_t, + AC_DEFINE(HAVE_INT8_T, 1, [Define if your compiler provides int8_t.]),,) +AC_TYPE_INT8_T + +AC_CHECK_TYPE(int16_t, + AC_DEFINE(HAVE_INT16_T, 1, [Define if your compiler provides int16_t.]),,) +AC_TYPE_INT16_T + AC_CHECK_TYPE(int32_t, AC_DEFINE(HAVE_INT32_T, 1, [Define if your compiler provides int32_t.]),,) AC_TYPE_INT32_T @@ -1730,6 +1747,8 @@ AC_CHECK_TYPES(uintptr_t, #ifdef HAVE_INTTYPES_H #include #endif]) +AC_TYPE_INTPTR_T +AC_TYPE_UINTPTR_T AC_CHECK_SIZEOF(off_t, [], [ #ifdef HAVE_SYS_TYPES_H