Index: Include/pyport.h =================================================================== --- Include/pyport.h (revision 85582) +++ Include/pyport.h (working copy) @@ -13,6 +13,10 @@ #include #endif +#ifdef __FreeBSD__ +#include +#endif + /************************************************************************** Symbols and macros to supply platform-independent interfaces to basic C language & library operations whose spellings vary across platforms. @@ -75,6 +79,16 @@ #endif #endif /* HAVE_LONG_LONG */ +/* FreeBSD 4 does not have *_MAX for exact-width integer types. */ +#ifdef __FreeBSD__ +#if __FreeBSD_version >= 400000 && __FreeBSD_version < 500000 +#define UINT32_MAX 0xffffffff +#define UINT64_MAX 0xffffffffffffffffULL +#define INT32_MAX 0x7fffffff +#define INT64_MAX 0x7fffffffffffffffLL +#endif +#endif + /* a build with 30-bit digits for Python long 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 @@ -635,7 +649,6 @@ */ #ifdef __FreeBSD__ -#include #if __FreeBSD_version > 500039 # define _PY_PORT_CTYPE_UTF8_ISSUE #endif