Skip to content

Commit 825509e

Browse files
authored
Drop superfluous LONG_MAX/LONG_MIN fallback definitions (GH-15667)
Both macros are supposed to be defined in limits.h (C99) and as such it is superfluous to provide fallback definitions. Even worse, because these fallback definitions didn't cater to LP64, ILP64 and SILP64 data models (and maybe some rather uncommon ones), but just assumed ILP32, they are confusing.
1 parent 2bc3df8 commit 825509e

File tree

4 files changed

+0
-25
lines changed

4 files changed

+0
-25
lines changed

Zend/zend_portability.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -444,14 +444,6 @@ char *alloca();
444444
# define ZTS_V 0
445445
#endif
446446

447-
#ifndef LONG_MAX
448-
# define LONG_MAX 2147483647L
449-
#endif
450-
451-
#ifndef LONG_MIN
452-
# define LONG_MIN (- LONG_MAX - 1)
453-
#endif
454-
455447
#define MAX_LENGTH_OF_DOUBLE 32
456448

457449
#undef MIN

Zend/zend_strtod.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,6 @@ static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
292292
#define DBL_MAX 1.7014118346046923e+38
293293
#endif
294294

295-
#ifndef LONG_MAX
296-
#define LONG_MAX 2147483647
297-
#endif
298-
299295
#else /* ifndef Bad_float_h */
300296
#include "float.h"
301297
#endif /* Bad_float_h */

ext/bcmath/libbcmath/src/bcmath.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ typedef struct bc_struct {
7474
#define MAX(a, b) ((a)>(b)?(a):(b))
7575
#define MIN(a, b) ((a)>(b)?(b):(a))
7676

77-
#ifndef LONG_MAX
78-
#define LONG_MAX 0x7fffffff
79-
#endif
80-
81-
8277
/* Function Prototypes */
8378

8479
void bc_init_numbers(void);

main/php.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,6 @@ typedef unsigned int socklen_t;
225225

226226
#include <limits.h>
227227

228-
#ifndef LONG_MAX
229-
#define LONG_MAX 2147483647L
230-
#endif
231-
232-
#ifndef LONG_MIN
233-
#define LONG_MIN (- LONG_MAX - 1)
234-
#endif
235-
236228
#ifndef INT_MAX
237229
#define INT_MAX 2147483647
238230
#endif

0 commit comments

Comments
 (0)