summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acinclude.m44
-rw-r--r--ext/intl/config.m42
-rw-r--r--ext/intl/config.w322
-rw-r--r--ext/intl/converter/converter.c4
-rw-r--r--ext/intl/grapheme/grapheme_string.c7
-rw-r--r--ext/intl/normalizer/normalizer_normalize.c3
-rw-r--r--ext/intl/uchar/uchar.c3
7 files changed, 21 insertions, 4 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index c4d0f46e4f..9f505a32aa 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2241,6 +2241,10 @@ AC_DEFUN([PHP_SETUP_ICU],[
ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
if test "$icu_version" -ge "49000"; then
ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit"
+ ICU_CFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
+ fi
+ if test "$icu_version" -ge "60000"; then
+ ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"
fi
fi
])
diff --git a/ext/intl/config.m4 b/ext/intl/config.m4
index 52408f8e91..4b9f469b38 100644
--- a/ext/intl/config.m4
+++ b/ext/intl/config.m4
@@ -9,7 +9,7 @@ if test "$PHP_INTL" != "no"; then
PHP_SETUP_ICU(INTL_SHARED_LIBADD)
PHP_SUBST(INTL_SHARED_LIBADD)
PHP_REQUIRE_CXX()
- INTL_COMMON_FLAGS="$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
+ INTL_COMMON_FLAGS="$ICU_INCS $ICU_CFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
if test "$icu_version" -ge "4002"; then
icu_spoof_src=" spoofchecker/spoofchecker_class.c \
spoofchecker/spoofchecker.c\
diff --git a/ext/intl/config.w32 b/ext/intl/config.w32
index 1f527dc7da..4ad4630054 100644
--- a/ext/intl/config.w32
+++ b/ext/intl/config.w32
@@ -129,7 +129,7 @@ if (PHP_INTL != "no") {
ADD_FLAG("LIBS_INTL", "iculx.lib");
}
- ADD_FLAG("CFLAGS_INTL", "/EHsc /DUNISTR_FROM_CHAR_EXPLICIT=explicit /DUNISTR_FROM_STRING_EXPLICIT=explicit");
+ ADD_FLAG("CFLAGS_INTL", "/EHsc /DUNISTR_FROM_CHAR_EXPLICIT=explicit /DUNISTR_FROM_STRING_EXPLICIT=explicit /DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 /DU_HIDE_OBSOLETE_UTF_OLD_H=1");
AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
} else {
WARNING("intl not enabled; libraries and/or headers not found");
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c
index 2de2576e3d..f54006fe69 100644
--- a/ext/intl/converter/converter.c
+++ b/ext/intl/converter/converter.c
@@ -18,6 +18,10 @@
#include "zend_exceptions.h"
#include <unicode/utypes.h>
+#if U_ICU_VERSION_MAJOR_NUM >= 49
+#include <unicode/utf8.h>
+#include <unicode/utf16.h>
+#endif
#include <unicode/ucnv.h>
#include <unicode/ustring.h>
diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c
index f2e29aad27..72ecbd5074 100644
--- a/ext/intl/grapheme/grapheme_string.c
+++ b/ext/intl/grapheme/grapheme_string.c
@@ -24,6 +24,9 @@
#include "grapheme_util.h"
#include <unicode/utypes.h>
+#if U_ICU_VERSION_MAJOR_NUM >= 49
+#include <unicode/utf8.h>
+#endif
#include <unicode/ucol.h>
#include <unicode/ustring.h>
#include <unicode/ubrk.h>
@@ -835,10 +838,10 @@ PHP_FUNCTION(grapheme_extract)
pstr = str + start;
/* just in case pstr points in the middle of a character, move forward to the start of the next char */
- if ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
+ if ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
char *str_end = str + str_len;
- while ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
+ while ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
pstr++;
if ( pstr >= str_end ) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
diff --git a/ext/intl/normalizer/normalizer_normalize.c b/ext/intl/normalizer/normalizer_normalize.c
index ad031de7d4..045a9c6d36 100644
--- a/ext/intl/normalizer/normalizer_normalize.c
+++ b/ext/intl/normalizer/normalizer_normalize.c
@@ -24,6 +24,9 @@
#include "normalizer_class.h"
#include "normalizer_normalize.h"
#include "intl_convert.h"
+#if U_ICU_VERSION_MAJOR_NUM >= 49
+#include <unicode/utf8.h>
+#endif
/* {{{ proto string Normalizer::normalize( string $input [, string $form = FORM_C] )
* Normalize a string. }}} */
diff --git a/ext/intl/uchar/uchar.c b/ext/intl/uchar/uchar.c
index 770622eca7..2cec0a4b8a 100644
--- a/ext/intl/uchar/uchar.c
+++ b/ext/intl/uchar/uchar.c
@@ -3,6 +3,9 @@
#include "intl_convert.h"
#include <unicode/uchar.h>
+#if U_ICU_VERSION_MAJOR_NUM >= 49
+#include <unicode/utf8.h>
+#endif
#define IC_METHOD(mname) PHP_METHOD(IntlChar, mname)