]> granicus.if.org Git - php/commitdiff
Rethink conditions
authorAnatol Belski <ab@php.net>
Fri, 6 Apr 2018 19:33:13 +0000 (21:33 +0200)
committerAnatol Belski <ab@php.net>
Fri, 6 Apr 2018 19:33:13 +0000 (21:33 +0200)
Raise the requirement to ICU 56. Mixing both old and new normalizer APIs
would create too much complexity. Therefore go by the recommended ICU
version where all the normalizer API became stable. For the older ICU,
the deprecated normalizer API is used.

ext/intl/normalizer/normalizer.c
ext/intl/normalizer/normalizer.h
ext/intl/normalizer/normalizer_class.c
ext/intl/normalizer/normalizer_normalize.c
ext/intl/normalizer/normalizer_normalize.h
ext/intl/php_intl.c

index 2f7555388ef0188bd7987368c9f55c729c3d1542..3c49fe584b4b99ae0bae97a7863bf5fed0566b86 100644 (file)
@@ -51,7 +51,7 @@ void normalizer_register_constants( INIT_FUNC_ARGS )
        NORMALIZER_EXPOSE_CLASS_CONST( NFC );
        NORMALIZER_EXPOSE_CLASS_CONST( FORM_KC );
        NORMALIZER_EXPOSE_CLASS_CONST( NFKC );
-#if U_ICU_VERSION_MAJOR_NUM >= 49
+#if U_ICU_VERSION_MAJOR_NUM >= 56
        NORMALIZER_EXPOSE_CLASS_CONST( FORM_KC_CF );
        NORMALIZER_EXPOSE_CLASS_CONST( NFKC_CF );
 #endif
index 8150f244f60cc1f94208b9aedce1160bf7523220..57f0466782f5336707b2ccc43e7d294c37193b80 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <php.h>
 #include <unicode/utypes.h>
-#if U_ICU_VERSION_MAJOR_NUM < 49
+#if U_ICU_VERSION_MAJOR_NUM < 56
 #include <unicode/unorm.h>
 
 #define NORMALIZER_NONE UNORM_NONE
index d6756b403b6e196efdc22005b4a8c839333cd0eb..5168b929ab5632c1a675aac7daf9e153c850a451 100644 (file)
@@ -34,7 +34,7 @@ ZEND_BEGIN_ARG_INFO_EX( normalizer_args, 0, 0, 1 )
        ZEND_ARG_INFO( 0, form )
 ZEND_END_ARG_INFO()
 
-#if U_ICU_VERSION_MAJOR_NUM >= 49
+#if U_ICU_VERSION_MAJOR_NUM >= 56
 ZEND_BEGIN_ARG_INFO_EX( decomposition_args, 0, 0, 1 )
        ZEND_ARG_INFO( 0, input )
 ZEND_END_ARG_INFO();
@@ -49,7 +49,7 @@ ZEND_END_ARG_INFO();
 static const zend_function_entry Normalizer_class_functions[] = {
        ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
        ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
-#if U_ICU_VERSION_MAJOR_NUM >= 49
+#if U_ICU_VERSION_MAJOR_NUM >= 56
        ZEND_FENTRY( getRawDecomposition, ZEND_FN( normalizer_get_raw_decomposition ), decomposition_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
 #endif
        PHP_FE_END
index e9431f2372cf818afce7b2e894c68bb77aa6c872..d5ec912848bdab005af706b4f94f5091847ff08f 100644 (file)
@@ -21,8 +21,7 @@
 #include "php_intl.h"
 #if U_ICU_VERSION_MAJOR_NUM < 56
 #include "unicode/unorm.h"
-#endif
-#if U_ICU_VERSION_MAJOR_NUM >= 49
+#else
 #include <unicode/unorm2.h>
 #endif
 #include "normalizer.h"
@@ -34,7 +33,7 @@
 #endif
 
 
-#if U_ICU_VERSION_MAJOR_NUM >= 49
+#if U_ICU_VERSION_MAJOR_NUM >= 56
 static const UNormalizer2 *intl_get_normalizer(zend_long form, UErrorCode *err)
 {/*{{{*/
        switch (form)
@@ -345,7 +344,7 @@ PHP_FUNCTION( normalizer_is_normalized )
 /* {{{ proto string|null normalizer_get_raw_decomposition( string $input [, string $form = FORM_C] )
  * Returns the Decomposition_Mapping property for the given UTF-8 encoded code point.
  */
-#if U_ICU_VERSION_MAJOR_NUM >= 49
+#if U_ICU_VERSION_MAJOR_NUM >= 56
 PHP_FUNCTION( normalizer_get_raw_decomposition )
 {
        char* input = NULL;
index ab053f79018a29ccf730b730058bfcc40b58bd70..2ed957758af4a73a1122c8802ee948e541053e27 100644 (file)
@@ -21,7 +21,7 @@
 
 PHP_FUNCTION( normalizer_normalize );
 PHP_FUNCTION( normalizer_is_normalized );
-#if U_ICU_VERSION_MAJOR_NUM >= 49
+#if U_ICU_VERSION_MAJOR_NUM >= 56
 PHP_FUNCTION( normalizer_get_raw_decomposition );
 #endif
 
index 9b52abc6fbc2e0cd234803ac5103dc3ccc2fd790..05832eaa343a1fc6dfb1b0620a29ed64435eb0bd 100644 (file)
@@ -206,7 +206,7 @@ ZEND_BEGIN_ARG_INFO_EX(normalizer_args, 0, 0, 1)
        ZEND_ARG_INFO(0, form)
 ZEND_END_ARG_INFO()
 
-#if U_ICU_VERSION_MAJOR_NUM >= 49
+#if U_ICU_VERSION_MAJOR_NUM >= 56
 ZEND_BEGIN_ARG_INFO_EX(decomposition_args, 0, 0, 1)
        ZEND_ARG_INFO(0, input)
 ZEND_END_ARG_INFO();
@@ -668,7 +668,7 @@ static const zend_function_entry intl_functions[] = {
        /* normalizer functions */
        PHP_FE( normalizer_normalize, normalizer_args )
        PHP_FE( normalizer_is_normalized, normalizer_args )
-#if U_ICU_VERSION_MAJOR_NUM >= 49
+#if U_ICU_VERSION_MAJOR_NUM >= 56
        PHP_FE( normalizer_get_raw_decomposition, decomposition_args )
 #endif