Merge pull request #8644 from radarhere/c99

Remove pre-C99 definitions
This commit is contained in:
Andrew Murray 2024-12-31 22:57:57 +11:00 committed by GitHub
commit 17f09f3993
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 30 deletions

View File

@ -68,6 +68,11 @@ Saving JPEG 2000 CMYK images
With OpenJPEG 2.5.3 or later, Pillow can now save CMYK images as JPEG 2000 files. With OpenJPEG 2.5.3 or later, Pillow can now save CMYK images as JPEG 2000 files.
Minimum C version
^^^^^^^^^^^^^^^^^
C99 is now the minimum version of C required to compile Pillow from source.
zlib-ng in wheels zlib-ng in wheels
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^

View File

@ -44,8 +44,6 @@
defines their own types with the same names, so we need to be able to undef defines their own types with the same names, so we need to be able to undef
ours before including the JPEG code. */ ours before including the JPEG code. */
#if __STDC_VERSION__ >= 199901L /* C99+ */
#include <stdint.h> #include <stdint.h>
#define INT8 int8_t #define INT8 int8_t
@ -55,34 +53,6 @@
#define INT32 int32_t #define INT32 int32_t
#define UINT32 uint32_t #define UINT32 uint32_t
#else /* < C99 */
#define INT8 signed char
#if SIZEOF_SHORT == 2
#define INT16 short
#elif SIZEOF_INT == 2
#define INT16 int
#else
#error Cannot find required 16-bit integer type
#endif
#if SIZEOF_SHORT == 4
#define INT32 short
#elif SIZEOF_INT == 4
#define INT32 int
#elif SIZEOF_LONG == 4
#define INT32 long
#else
#error Cannot find required 32-bit integer type
#endif
#define UINT8 unsigned char
#define UINT16 unsigned INT16
#define UINT32 unsigned INT32
#endif /* < C99 */
#endif /* not WIN */ #endif /* not WIN */
/* assume IEEE; tweak if necessary (patches are welcome) */ /* assume IEEE; tweak if necessary (patches are welcome) */