]> granicus.if.org Git - php/commitdiff
Check feature availability as ICU < 49 is still supported
authorAnatol Belski <ab@php.net>
Thu, 5 Apr 2018 16:08:49 +0000 (18:08 +0200)
committerAnatol Belski <ab@php.net>
Thu, 5 Apr 2018 16:08:49 +0000 (18:08 +0200)
ext/intl/normalizer/normalizer_class.c
ext/intl/normalizer/normalizer_normalize.c
ext/intl/normalizer/normalizer_normalize.h
ext/intl/php_intl.c
ext/intl/tests/normalizer_get_raw_decomposition.phpt

index 95b738ef0734417f572517a1275904fbfee30447..d6756b403b6e196efdc22005b4a8c839333cd0eb 100644 (file)
@@ -34,9 +34,11 @@ 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
 ZEND_BEGIN_ARG_INFO_EX( decomposition_args, 0, 0, 1 )
        ZEND_ARG_INFO( 0, input )
 ZEND_END_ARG_INFO();
+#endif
 
 /* }}} */
 
@@ -47,7 +49,9 @@ 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
        ZEND_FENTRY( getRawDecomposition, ZEND_FN( normalizer_get_raw_decomposition ), decomposition_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
+#endif
        PHP_FE_END
 };
 /* }}} */
index 045a9c6d36ea626b130080a6dbc08750b6a15ecc..c0ab8341d41500f6562dbfaaffffbf765d52c304 100644 (file)
@@ -255,6 +255,7 @@ PHP_FUNCTION( normalizer_is_normalized )
 /* {{{ proto string|null normalizer_get_raw_decomposition( string $input )
  * Returns the Decomposition_Mapping property for the given UTF-8 encoded code point.
  */
+#if U_ICU_VERSION_MAJOR_NUM >= 49
 PHP_FUNCTION( normalizer_get_raw_decomposition )
 {
        char* input = NULL;
@@ -294,6 +295,7 @@ PHP_FUNCTION( normalizer_get_raw_decomposition )
 
        RETVAL_NEW_STR(intl_convert_utf16_to_utf8(decomposition, decomposition_length, &status));
 }
+#endif
 /* }}} */
 
 /*
index f8d032177735584442080377e593581030c7bb20..ab053f79018a29ccf730b730058bfcc40b58bd70 100644 (file)
@@ -21,6 +21,8 @@
 
 PHP_FUNCTION( normalizer_normalize );
 PHP_FUNCTION( normalizer_is_normalized );
+#if U_ICU_VERSION_MAJOR_NUM >= 49
 PHP_FUNCTION( normalizer_get_raw_decomposition );
+#endif
 
 #endif // NORMALIZER_NORMALIZE_H
index 0afc96b08198408fd84012119c2185fc3c698c2e..9b52abc6fbc2e0cd234803ac5103dc3ccc2fd790 100644 (file)
@@ -206,9 +206,11 @@ 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
 ZEND_BEGIN_ARG_INFO_EX(decomposition_args, 0, 0, 1)
        ZEND_ARG_INFO(0, input)
 ZEND_END_ARG_INFO();
+#endif
 
 ZEND_BEGIN_ARG_INFO_EX(grapheme_1_arg, 0, 0, 1)
        ZEND_ARG_INFO(0, string)
@@ -666,7 +668,9 @@ 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
        PHP_FE( normalizer_get_raw_decomposition, decomposition_args )
+#endif
 
        /* Locale functions */
        PHP_NAMED_FE( locale_get_default, zif_locale_get_default, locale_0_args )
index 69eb01366b6a2bd60a32209eb3ba9d6fdb3b57ad..8a6f960cb334fb24d22c8d6e3732cc2f3c0c3f90 100644 (file)
@@ -2,6 +2,7 @@
 normalizer_get_raw_decomposition()
 --SKIPIF--
 <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if( !function_exists( 'normalizer_get_raw_decomposition' ) ) print 'skip'; ?>
 --FILE--
 <?php