mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Use INT_MAX/LONG_MAX instead of non-ANSI LONG_BIT
This commit is contained in:
parent
3d602e31b1
commit
be6da271a1
1 changed files with 4 additions and 5 deletions
|
@ -48,16 +48,15 @@ typedef unsigned short int UINT2;
|
||||||
#ifdef HAVE_LIMITS_H
|
#ifdef HAVE_LIMITS_H
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#else
|
#else
|
||||||
#ifndef LONG_BIT
|
/* Wild guess */
|
||||||
#define LONG_BIT 32
|
#define LONG_MAX 2147483647L
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* UINT4 defines a four byte word */
|
/* UINT4 defines a four byte word */
|
||||||
#if WORD_BIT == 32
|
#if defined(INT_MAX) && INT_MAX == 2147483647
|
||||||
typedef unsigned int UINT4;
|
typedef unsigned int UINT4;
|
||||||
#else
|
#else
|
||||||
#if LONG_BIT == 32
|
#if defined(LONG_MAX) && LONG_MAX == 2147483647L
|
||||||
typedef unsigned long int UINT4;
|
typedef unsigned long int UINT4;
|
||||||
#endif
|
#endif
|
||||||
/* Too bad if neither is */
|
/* Too bad if neither is */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue