summaryrefslogtreecommitdiff
path: root/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2012-06-25 12:03:27 +0200
committerGustavo André dos Santos Lopes <cataphract@php.net>2012-06-25 12:05:13 +0200
commitd8b067e66f4b458108821df512090ede623df214 (patch)
tree56d04447b6c72afa7f950356ce0625bf3ebc7b78 /ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
parent5a9dca458a517f62fc596c57594a02c363c5a3c0 (diff)
downloadphp-git-d8b067e66f4b458108821df512090ede623df214.tar.gz
BreakIterator: fix compat with old ICU versions
Diffstat (limited to 'ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp')
-rw-r--r--ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
index 288179a785..41ebfe5e0f 100644
--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
+++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
@@ -73,12 +73,18 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
RETURN_NULL();
}
} else { // compiled
+#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
rbbi = new RuleBasedBreakIterator((uint8_t*)rules, rules_len, status);
if (U_FAILURE(status)) {
intl_error_set(NULL, status, "rbbi_create_instance: unable to "
"creaete instance from compiled rules", 0 TSRMLS_CC);
RETURN_NULL();
}
+#else
+ intl_error_set(NULL, U_UNSUPPORTED_ERROR, "rbbi_create_instance: "
+ "compiled rules require ICU >= 4.8", 0 TSRMLS_CC);
+ RETURN_NULL();
+#endif
}
breakiterator_object_create(return_value, rbbi TSRMLS_CC);
@@ -180,6 +186,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec)
delete[] rules;
}
+#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules)
{
BREAKITER_METHOD_INIT_VARS;
@@ -209,3 +216,4 @@ U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules)
RETURN_STRINGL(ret_rules, rules_len, 0);
}
+#endif