Skip to content

Commit 8e9310e

Browse files
committed
Deprecate ZEND_SIZE_MAX and point to SIZE_MAX directly
1 parent dee0042 commit 8e9310e

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

Zend/zend_types.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,8 @@ typedef enum {
6262

6363
typedef ZEND_RESULT_CODE zend_result;
6464

65-
#ifdef ZEND_ENABLE_ZVAL_LONG64
66-
# ifdef ZEND_WIN32
67-
# define ZEND_SIZE_MAX _UI64_MAX
68-
# else
69-
# define ZEND_SIZE_MAX SIZE_MAX
70-
# endif
71-
#else
72-
# if defined(ZEND_WIN32)
73-
# define ZEND_SIZE_MAX _UI32_MAX
74-
# else
75-
# define ZEND_SIZE_MAX SIZE_MAX
76-
# endif
77-
#endif
65+
/* This constant is deprecated, use SIZE_MAX instead */
66+
#define ZEND_SIZE_MAX SIZE_MAX
7867

7968
#ifdef ZTS
8069
#define ZEND_TLS static TSRM_TLS

ext/standard/formatted_print.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ php_sprintf_appendstring(zend_string **buffer, size_t *pos, char *add,
103103
if (req_size > ZSTR_LEN(*buffer)) {
104104
size_t size = ZSTR_LEN(*buffer);
105105
while (req_size > size) {
106-
if (size > ZEND_SIZE_MAX/2) {
106+
if (size > SIZE_MAX/2) {
107107
zend_error_noreturn(E_ERROR, "Field width %zd is too long", req_size);
108108
}
109109
size <<= 1;

0 commit comments

Comments
 (0)