com php-src: Remove HAVE_LIMITS_H: TSRM/tsrm_config _common.h Zend/Zend.m4 Zend/zend_alloc.c Zend /zend_portability.h ext/standard/exec.c
ext/standard/ string.c ext/standard/url_scanner_ex.re main/php. h
| From: | Peter Kokot | Date: | Sun, 07 Apr 2019 13:20:02 +0000 |
| Subject: | com php-src: Remove HAVE_LIMITS_H: TSRM/tsrm_config _common.h Zend/Zend.m4 Zend/zend_alloc.c Zend /zend_portability.h ext/standard/exec.c ext/standard/ string.c ext/standard/url_scanner_ex.re main/php. h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105550@lists.php.net to get a copy of this message | ||
Commit: fd1ad1e25a6d0676a560d237ff5f44faa6e1dc87
Author: Peter Kokot <peterkokot@gmail.com> Sun, 7 Apr 2019 15:20:02 +0200
Parents: afd52f9d9986d92dd0c63832a07ab1a16bf11d53
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fd1ad1e25a6d0676a560d237ff5f44faa6e1dc87
Log:
Remove HAVE_LIMITS_H
The
<limits.h> header file is part of the standard C89 headers [1]
and on current systems can be included unconditionally.
Since PHP requires at least C89 or greater, the HAVE_LIMITS_H symbol
defined by Autoconf in configure.ac [2] can be ommitted and simplifed
however due to bundled file library (libmagic) and timelib still using
it, the removal there was omitted and done only in Zend.m4 file.
Current bundled libraries libtime, oniguruma, and libmagic still include
partial HAVE_LIMITS_H usage and will be more refactored when this is
possible.
Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu..org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
Bugs:
https://bugs.php.net/4
Changed paths:
M TSRM/tsrm_config_common.h
M Zend/Zend.m4
M Zend/zend_alloc.c
M Zend/zend_portability.h
M ext/standard/exec.c
M ext/standard/string.c
M ext/standard/url_scanner_ex.re
M main/php.h
Diff:
diff --git a/TSRM/tsrm_config_common.h b/TSRM/tsrm_config_common.h
index 64cecd9..d3c7672 100644
--- a/TSRM/tsrm_config_common.h
+++ b/TSRM/tsrm_config_common.h
@@ -35,9 +35,7 @@ char *alloca ();
#include <unistd.h>
#endif
-#if HAVE_LIMITS_H
#include <limits.h>
-#endif
#ifndef MAXPATHLEN
# if _WIN32
diff --git a/Zend/Zend.m4 b/Zend/Zend.m4
index 2940463..c0ada26 100644
--- a/Zend/Zend.m4
+++ b/Zend/Zend.m4
@@ -8,7 +8,6 @@ AC_REQUIRE([AC_PROG_CC])
AC_CHECK_HEADERS(
inttypes.h \
stdint.h \
-limits.h \
malloc.h \
unistd.h \
sys/types.h \
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index dabf481..77474c5 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -77,9 +77,7 @@
#include <sys/types.h>
#include <sys/stat.h>
-#if HAVE_LIMITS_H
#include <limits.h>
-#endif
#include <fcntl.h>
#include <errno.h>
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index fe3f5c4..56b7a1a 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -60,9 +60,7 @@
# include <dlfcn.h>
#endif
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
+#include <limits.h>
#if HAVE_ALLOCA_H && !defined(_ALLOCA_H)
# include <alloca.h>
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 63e1d97..3839945 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -49,9 +49,7 @@
#include <unistd.h>
#endif
-#if HAVE_LIMITS_H
#include <limits.h>
-#endif
#ifdef PHP_WIN32
# include "win32/nice.h"
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 194ce9f..8fb0e81 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -90,12 +90,6 @@ void register_string_constants(INIT_FUNC_ARGS)
#ifdef HAVE_LOCALECONV
/* If last members of struct lconv equal CHAR_MAX, no grouping is done */
-
-/* This is bad, but since we are going to be hardcoding in the POSIX stuff anyway... */
-# ifndef HAVE_LIMITS_H
-# define CHAR_MAX 127
-# endif
-
REGISTER_LONG_CONSTANT("CHAR_MAX", CHAR_MAX, CONST_CS | CONST_PERSISTENT);
#endif
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index 0386d0e..8ad1293 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -22,10 +22,8 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/main/php.h b/main/php.h
index 17aa3b3..8883443 100644
--- a/main/php.h
+++ b/main/php.h
@@ -243,9 +243,7 @@ char *strerror(int);
# endif
#endif
-#if HAVE_LIMITS_H
#include <limits.h>
-#endif
#ifndef LONG_MAX
#define LONG_MAX 2147483647L