Skip to content

Commit 0c54df0

Browse files
committed
Drop support of not C99+ compilers (including old MSVC)
1 parent 39acff0 commit 0c54df0

File tree

3 files changed

+4
-65
lines changed

3 files changed

+4
-65
lines changed

src/libImaging/Draw.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include "Imaging.h"
3636

3737
#include <math.h>
38-
#include <stdint.h>
3938

4039
#define CEIL(v) (int)ceil(v)
4140
#define FLOOR(v) ((v) >= 0.0 ? (int)(v) : (int)floor(v))

src/libImaging/ImagingPlatform.h

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) Fredrik Lundh 1995-2003.
88
*/
99

10-
#include "Python.h"
10+
#include <Python.h>
1111

1212
/* Check that we have an ANSI compliant compiler */
1313
#ifndef HAVE_PROTOTYPES
@@ -17,34 +17,13 @@
1717
#error Sorry, this library requires ANSI header files.
1818
#endif
1919

20-
#if defined(PIL_NO_INLINE)
21-
#define inline
22-
#else
2320
#if defined(_MSC_VER) && !defined(__GNUC__)
2421
#define inline __inline
2522
#endif
26-
#endif
27-
28-
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
29-
30-
#define WIN32_LEAN_AND_MEAN
31-
#include <Windows.h>
32-
33-
#ifdef __CYGWIN__
34-
#undef _WIN64
35-
#undef _WIN32
36-
#undef __WIN32__
37-
#undef WIN32
38-
#endif
3923

40-
#else /* not WIN */
41-
/* For System that are not Windows, we'll need to define these. */
42-
/* We have to define them instead of using typedef because the JPEG lib also
24+
/* We have to define types instead of using typedef because the JPEG lib also
4325
defines their own types with the same names, so we need to be able to undef
4426
ours before including the JPEG code. */
45-
46-
#if __STDC_VERSION__ >= 199901L /* C99+ */
47-
4827
#include <stdint.h>
4928

5029
#define INT8 int8_t
@@ -54,45 +33,11 @@
5433
#define INT32 int32_t
5534
#define UINT32 uint32_t
5635

57-
#else /* < C99 */
58-
59-
#define INT8 signed char
60-
61-
#if SIZEOF_SHORT == 2
62-
#define INT16 short
63-
#elif SIZEOF_INT == 2
64-
#define INT16 int
65-
#else
66-
#error Cannot find required 16-bit integer type
67-
#endif
68-
69-
#if SIZEOF_SHORT == 4
70-
#define INT32 short
71-
#elif SIZEOF_INT == 4
72-
#define INT32 int
73-
#elif SIZEOF_LONG == 4
74-
#define INT32 long
75-
#else
76-
#error Cannot find required 32-bit integer type
77-
#endif
78-
79-
#define UINT8 unsigned char
80-
#define UINT16 unsigned INT16
81-
#define UINT32 unsigned INT32
82-
83-
#endif /* < C99 */
84-
85-
#endif /* not WIN */
86-
8736
/* assume IEEE; tweak if necessary (patches are welcome) */
8837
#define FLOAT16 UINT16
8938
#define FLOAT32 float
9039
#define FLOAT64 double
9140

92-
#ifdef _MSC_VER
93-
typedef signed __int64 int64_t;
94-
#endif
95-
9641
#ifdef __GNUC__
9742
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
9843
#endif

src/libImaging/QuantTypes.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@
99
* See the README file for information on usage and redistribution.
1010
*/
1111

12-
#ifndef __TYPES_H__
13-
#define __TYPES_H__
12+
#ifndef __QUANTTYPES_H__
13+
#define __QUANTTYPES_H__
1414

15-
#ifdef _MSC_VER
16-
typedef unsigned __int32 uint32_t;
17-
typedef unsigned __int64 uint64_t;
18-
#else
1915
#include <stdint.h>
20-
#endif
2116

2217
typedef union {
2318
struct {

0 commit comments

Comments
 (0)