OLD | NEW |
1 #ifndef Py_PYPORT_H | 1 #ifndef Py_PYPORT_H |
2 #define Py_PYPORT_H | 2 #define Py_PYPORT_H |
3 | 3 |
4 #include "pyconfig.h" /* include for defines */ | 4 #include "pyconfig.h" /* include for defines */ |
5 | 5 |
6 /* Some versions of HP-UX & Solaris need inttypes.h for int32_t, | 6 /* Some versions of HP-UX & Solaris need inttypes.h for int32_t, |
7 INT32_MAX, etc. */ | 7 INT32_MAX, etc. */ |
8 #ifdef HAVE_INTTYPES_H | 8 #ifdef HAVE_INTTYPES_H |
9 #include <inttypes.h> | 9 #include <inttypes.h> |
10 #endif | 10 #endif |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 #ifndef PYLONG_BITS_IN_DIGIT | 120 #ifndef PYLONG_BITS_IN_DIGIT |
121 #if (defined HAVE_UINT64_T && defined HAVE_INT64_T && \ | 121 #if (defined HAVE_UINT64_T && defined HAVE_INT64_T && \ |
122 defined HAVE_UINT32_T && defined HAVE_INT32_T && SIZEOF_VOID_P >= 8) | 122 defined HAVE_UINT32_T && defined HAVE_INT32_T && SIZEOF_VOID_P >= 8) |
123 #define PYLONG_BITS_IN_DIGIT 30 | 123 #define PYLONG_BITS_IN_DIGIT 30 |
124 #else | 124 #else |
125 #define PYLONG_BITS_IN_DIGIT 15 | 125 #define PYLONG_BITS_IN_DIGIT 15 |
126 #endif | 126 #endif |
127 #endif | 127 #endif |
128 | 128 |
| 129 /* Parameters used for the numeric hash implementation. See notes for |
| 130 _PyHash_Double in Objects/object.c. Numeric hashes are based on |
| 131 reduction modulo the prime 2**_PyHASH_BITS - 1. */ |
| 132 |
| 133 #if SIZEOF_LONG >= 8 |
| 134 #define _PyHASH_BITS 61 |
| 135 #else |
| 136 #define _PyHASH_BITS 31 |
| 137 #endif |
| 138 #define _PyHASH_MODULUS ((1UL << _PyHASH_BITS) - 1) |
| 139 #define _PyHASH_INF 314159 |
| 140 #define _PyHASH_NAN 0 |
| 141 #define _PyHASH_IMAG 1000003UL |
| 142 |
129 /* uintptr_t is the C9X name for an unsigned integral type such that a | 143 /* uintptr_t is the C9X name for an unsigned integral type such that a |
130 * legitimate void* can be cast to uintptr_t and then back to void* again | 144 * legitimate void* can be cast to uintptr_t and then back to void* again |
131 * without loss of information. Similarly for intptr_t, wrt a signed | 145 * without loss of information. Similarly for intptr_t, wrt a signed |
132 * integral type. | 146 * integral type. |
133 */ | 147 */ |
134 #ifdef HAVE_UINTPTR_T | 148 #ifdef HAVE_UINTPTR_T |
135 typedef uintptr_t Py_uintptr_t; | 149 typedef uintptr_t Py_uintptr_t; |
136 typedef intptr_t Py_intptr_t; | 150 typedef intptr_t Py_intptr_t; |
137 | 151 |
138 #elif SIZEOF_VOID_P <= SIZEOF_INT | 152 #elif SIZEOF_VOID_P <= SIZEOF_INT |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 */ | 816 */ |
803 #ifndef Py_LL | 817 #ifndef Py_LL |
804 #define Py_LL(x) x##LL | 818 #define Py_LL(x) x##LL |
805 #endif | 819 #endif |
806 | 820 |
807 #ifndef Py_ULL | 821 #ifndef Py_ULL |
808 #define Py_ULL(x) Py_LL(x##U) | 822 #define Py_ULL(x) Py_LL(x##U) |
809 #endif | 823 #endif |
810 | 824 |
811 #endif /* Py_PYPORT_H */ | 825 #endif /* Py_PYPORT_H */ |
OLD | NEW |