Skip to content

Commit 9359486

Browse files
committed
Remove no longer needed stdint compatibility defines
Closes GH-5886.
1 parent 14400b5 commit 9359486

File tree

2 files changed

+5
-149
lines changed

2 files changed

+5
-149
lines changed

build/php.m4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,9 @@ AC_DEFUN([PHP_CHECK_STDINT_TYPES], [
24252425
AC_CHECK_SIZEOF([long long])
24262426
AC_CHECK_SIZEOF([size_t])
24272427
AC_CHECK_SIZEOF([off_t])
2428-
AC_CHECK_TYPES([int8, int16, int32, int64, int8_t, int16_t, int32_t, int64_t, uint8, uint16, uint32, uint64, uint8_t, uint16_t, uint32_t, uint64_t, u_int8_t, u_int16_t, u_int32_t, u_int64_t], [], [], [
2428+
AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t], [], [
2429+
AC_MSG_ERROR([One of the intN_t or uintN_t types is not available])
2430+
], [
24292431
#include <stdint.h>
24302432
#if HAVE_SYS_TYPES_H
24312433
# include <sys/types.h>

main/php_stdint.h

Lines changed: 2 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -41,157 +41,11 @@
4141

4242
#include <inttypes.h>
4343
#include <stdint.h>
44+
4445
#if defined(_MSC_VER)
4546
# ifndef u_char
4647
typedef unsigned __int8 u_char;
4748
# endif
48-
#else
49-
50-
#include "php_config.h"
51-
52-
#if HAVE_SYS_TYPES_H
53-
# include <sys/types.h>
54-
#endif
55-
56-
#ifndef HAVE_INT8_T
57-
# ifdef HAVE_INT8
58-
typedef int8 int8_t;
59-
# else
60-
typedef signed char int8_t;
61-
# endif
62-
#endif
63-
64-
#ifndef INT8_C
65-
# define INT8_C(c) c
66-
#endif
67-
68-
#ifndef HAVE_UINT8_T
69-
# ifdef HAVE_UINT8
70-
typedef uint8 uint8_t
71-
# elif HAVE_U_INT8_T
72-
typedef u_int8_t uint8_t;
73-
# else
74-
typedef unsigned char uint8_t;
75-
# endif
76-
#endif
77-
78-
#ifndef UINT8_C
79-
# define UINT8_C(c) c
80-
#endif
81-
82-
#ifndef HAVE_INT16_T
83-
# ifdef HAVE_INT16
84-
typedef int16 int16_t;
85-
# elif SIZEOF_SHORT >= 2
86-
typedef signed short int16_t;
87-
# else
88-
# error "No suitable 16bit integer type found"
89-
# endif
90-
#endif
91-
92-
#ifndef INT16_C
93-
# define INT16_C(c) c
94-
#endif
95-
96-
#ifndef HAVE_UINT16_T
97-
# ifdef HAVE_UINT16
98-
typedef uint16 uint16_t
99-
# elif HAVE_U_INT16_T
100-
typedef u_int16_t uint16_t;
101-
# elif SIZEOF_SHORT >= 2
102-
typedef unsigned short uint16_t;
103-
# else
104-
# error "No suitable 16bit integer type found"
105-
# endif
106-
#endif
107-
108-
#ifndef UINT16_C
109-
# define UINT16_C(c) c
110-
#endif
111-
112-
#ifndef HAVE_INT32_T
113-
# ifdef HAVE_INT32
114-
typedef int32 int32_t;
115-
# elif SIZEOF_INT >= 4
116-
typedef int int32_t;
117-
# elif SIZEOF_LONG >= 4
118-
typedef long int32_t;
119-
# else
120-
# error "No suitable 32bit integer type found"
121-
# endif
122-
#endif
123-
124-
#ifndef INT32_C
125-
# define INT32_C(c) c
126-
#endif
127-
128-
#ifndef HAVE_UINT32_T
129-
# ifdef HAVE_UINT32
130-
typedef uint32 uint32_t
131-
# elif HAVE_U_INT32_T
132-
typedef u_int32_t uint32_t;
133-
# elif SIZEOF_INT >= 4
134-
typedef unsigned int uint32_t;
135-
# elif SIZEOF_LONG >= 4
136-
typedef unsigned long uint32_t;
137-
# else
138-
# error "No suitable 32bit integer type found"
139-
# endif
140-
#endif
141-
142-
#ifndef UINT32_C
143-
# define UINT32_C(c) c ## U
144-
#endif
145-
146-
#ifndef HAVE_INT64_T
147-
# ifdef HAVE_INT64
148-
typedef int64 int64_t;
149-
# elif SIZEOF_INT >= 8
150-
typedef int int64_t;
151-
# elif SIZEOF_LONG >= 8
152-
typedef long int64_t;
153-
# elif SIZEOF_LONG_LONG >= 8
154-
typedef long long int64_t;
155-
# else
156-
# error "No suitable 64bit integer type found"
157-
# endif
158-
#endif
159-
160-
#ifndef INT64_C
161-
# if SIZEOF_INT >= 8
162-
# define INT64_C(c) c
163-
# elif SIZEOF_LONG >= 8
164-
# define INT64_C(c) c ## L
165-
# elif SIZEOF_LONG_LONG >= 8
166-
# define INT64_C(c) c ## LL
167-
# endif
168-
#endif
169-
170-
#ifndef HAVE_UINT64_T
171-
# ifdef HAVE_UINT64
172-
typedef uint64 uint64_t
173-
# elif HAVE_U_INT64_T
174-
typedef u_int64_t uint64_t;
175-
# elif SIZEOF_INT >= 8
176-
typedef unsigned int uint64_t;
177-
# elif SIZEOF_LONG >= 8
178-
typedef unsigned long uint64_t;
179-
# elif SIZEOF_LONG_LONG >= 8
180-
typedef unsigned long long uint64_t;
181-
# else
182-
# error "No suitable 64bit integer type found"
183-
# endif
184-
#endif
185-
186-
#ifndef UINT64_C
187-
# if SIZEOF_INT >= 8
188-
# define UINT64_C(c) c ## U
189-
# elif SIZEOF_LONG >= 8
190-
# define UINT64_C(c) c ## UL
191-
# elif SIZEOF_LONG_LONG >= 8
192-
# define UINT64_C(c) c ## ULL
193-
# endif
194-
#endif
49+
#endif /* !_MSC_VER */
19550

196-
#endif /* !PHP_WIN32 */
19751
#endif /* PHP_STDINT_H */

0 commit comments

Comments
 (0)