diff options
author | Peter Kokot <peterkokot@gmail.com> | 2019-02-24 10:21:25 +0100 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2019-04-07 18:32:54 +0200 |
commit | e06836a1a345d0f6975036dc6c0cf7596aa07031 (patch) | |
tree | 3e46afae0d1303c0e568875bd661c6d6480f43a3 /ext/standard/html.c | |
parent | 5f8915786f9fc3ec1af1089c9848f65a8d1541f5 (diff) | |
download | php-git-e06836a1a345d0f6975036dc6c0cf7596aa07031.tar.gz |
Remove checks for locale.h, setlocale, localeconv
The `<loccale.h>` header file, setlocale, and localeconv are part of the
standard C89 [1] and on current systems can be used unconditionally.
Since PHP 7.4 requires at least C89 or greater, the `HAVE_LOCALE_H`,
`HAVE_SETLOCALE`, and `HAVE_LOCALECONV` symbols defined by Autoconf in
configure.ac [2] can be ommitted and simplifed.
The bundled libmagic (file) has also been patched already in version
5.35 and up in upstream location so when it will be patched also in
php-src the check for locale.h header is still left in the configure.ac
and in windows headers definition file.
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.4
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
Omit the bundled libmagic files
Diffstat (limited to 'ext/standard/html.c')
-rw-r--r-- | ext/standard/html.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/standard/html.c b/ext/standard/html.c index d69082939c..0cdfca6d85 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -45,9 +45,7 @@ #include "php_standard.h" #include "php_string.h" #include "SAPI.h" -#if HAVE_LOCALE_H #include <locale.h> -#endif #if HAVE_LANGINFO_H #include <langinfo.h> #endif @@ -408,14 +406,13 @@ static enum entity_charset determine_charset(char *charset_hint) } /* try to detect the charset for the locale */ -#if HAVE_NL_LANGINFO && HAVE_LOCALE_H && defined(CODESET) +#if HAVE_NL_LANGINFO && defined(CODESET) charset_hint = nl_langinfo(CODESET); if (charset_hint != NULL && (len=strlen(charset_hint)) != 0) { goto det_charset; } #endif -#if HAVE_LOCALE_H /* try to figure out the charset from the locale */ { char *localename; @@ -441,7 +438,6 @@ static enum entity_charset determine_charset(char *charset_hint) len = strlen(charset_hint); } } -#endif det_charset: |