|
32 | 32 | #ifndef _PYTHON_ZSTD_H_ |
33 | 33 | #define _PYTHON_ZSTD_H_ |
34 | 34 |
|
| 35 | +/************************************** |
| 36 | +* Basic Types : need as sooner as possible |
| 37 | +**************************************/ |
| 38 | +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ |
| 39 | +# include <stdint.h> |
| 40 | +typedef uint8_t BYTE; |
| 41 | +typedef uint16_t U16; |
| 42 | +typedef uint32_t U32; |
| 43 | +typedef int32_t S32; |
| 44 | +typedef int64_t S64; |
| 45 | +typedef uint64_t U64; |
| 46 | +#else |
| 47 | +typedef unsigned char BYTE; |
| 48 | +typedef unsigned short U16; |
| 49 | +typedef unsigned int U32; |
| 50 | +typedef signed int S32; |
| 51 | +typedef signed long long S64; |
| 52 | +typedef unsigned long long U64; |
| 53 | +#endif |
| 54 | + |
| 55 | +#if defined(_WIN32) && defined(_MSC_VER) |
| 56 | +# define inline __inline |
| 57 | +# if _MSC_VER >= 1600 |
| 58 | +# include <stdint.h> |
| 59 | +# else /* _MSC_VER >= 1600 */ |
| 60 | + typedef signed char int8_t; |
| 61 | + typedef signed short int16_t; |
| 62 | + typedef signed int int32_t; |
| 63 | + typedef signed long long int64_t; |
| 64 | + typedef unsigned char uint8_t; |
| 65 | + typedef unsigned short uint16_t; |
| 66 | + typedef unsigned int uint32_t; |
| 67 | + typedef unsigned long long uint64_t; |
| 68 | +# endif /* _MSC_VER >= 1600 */ |
| 69 | +#endif |
35 | 70 | #define UNUSED(x) (void)(x) |
36 | 71 |
|
37 | 72 | #include "Python.h" |
@@ -153,41 +188,6 @@ Raises a zstd.Error exception if any error occurs." |
153 | 188 | #define UNCOMPRESS_OLD_DOCSTRING "decompress_old("PY_BYTESTR_TYPE"): string -- Decompress string, old version, returning the uncompressed data.\n\nUses custom format from `compress_old` fucntion.\nNot compatible with streaming or origin compression tools.\n\nRaises a zstd.Error exception if any error occurs.\n\n@deprecated" |
154 | 189 | #endif |
155 | 190 |
|
156 | | -/************************************** |
157 | | -* Basic Types |
158 | | -**************************************/ |
159 | | -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ |
160 | | -# include <stdint.h> |
161 | | -typedef uint8_t BYTE; |
162 | | -typedef uint16_t U16; |
163 | | -typedef uint32_t U32; |
164 | | -typedef int32_t S32; |
165 | | -typedef int64_t S64; |
166 | | -typedef uint64_t U64; |
167 | | -#else |
168 | | -typedef unsigned char BYTE; |
169 | | -typedef unsigned short U16; |
170 | | -typedef unsigned int U32; |
171 | | -typedef signed int S32; |
172 | | -typedef signed long long S64; |
173 | | -typedef unsigned long long U64; |
174 | | -#endif |
175 | | - |
176 | | -#if defined(_WIN32) && defined(_MSC_VER) |
177 | | -# define inline __inline |
178 | | -# if _MSC_VER >= 1600 |
179 | | -# include <stdint.h> |
180 | | -# else /* _MSC_VER >= 1600 */ |
181 | | - typedef signed char int8_t; |
182 | | - typedef signed short int16_t; |
183 | | - typedef signed int int32_t; |
184 | | - typedef signed long long int64_t; |
185 | | - typedef unsigned char uint8_t; |
186 | | - typedef unsigned short uint16_t; |
187 | | - typedef unsigned int uint32_t; |
188 | | - typedef unsigned long long uint64_t; |
189 | | -# endif /* _MSC_VER >= 1600 */ |
190 | | -#endif |
191 | 191 |
|
192 | 192 | #if defined(__SUNPRO_C) || defined(__hpux) || defined(_AIX) |
193 | 193 | #define inline |
|
0 commit comments