12
12
+----------------------------------------------------------------------+
13
13
*/
14
14
15
+ extern " C" {
16
+ #include " php.h"
17
+ #include " zend_API.h"
18
+ #include " ../intl_common.h"
19
+ }
20
+
21
+ #if U_ICU_VERSION_MAJOR_NUM >= 63
15
22
#include < unicode/numberrangeformatter.h>
16
23
#include < unicode/unumberrangeformatter.h>
17
24
#include < unicode/numberformatter.h>
18
25
#include < unicode/unistr.h>
19
26
#include " ../intl_convertcpp.h"
27
+ #endif
20
28
21
29
extern " C" {
22
- #include " php.h"
23
- #include " zend_API.h"
24
- #include " ../intl_common.h"
25
30
#include " ../intl_error.h"
26
31
#include " ../php_intl.h"
27
32
#include " ../intl_data.h"
@@ -30,12 +35,14 @@ extern "C" {
30
35
#include " intl_convert.h"
31
36
}
32
37
38
+ #if U_ICU_VERSION_MAJOR_NUM >= 63
33
39
using icu::number::NumberRangeFormatter;
34
40
using icu::number::NumberFormatter;
35
41
using icu::number::UnlocalizedNumberFormatter;
36
42
using icu::number::LocalizedNumberRangeFormatter;
37
43
using icu::UnicodeString;
38
44
using icu::MeasureUnit;
45
+ #endif
39
46
40
47
static zend_object_handlers rangeformatter_handlers;
41
48
zend_class_entry *class_entry_IntlNumberRangeFormatter;
@@ -68,8 +75,7 @@ U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, createFromSkeleton)
68
75
#if U_ICU_VERSION_MAJOR_NUM < 63
69
76
zend_throw_error (NULL , " IntlNumberRangeFormatter is not available in ICU 62 and earlier" );
70
77
RETURN_THROWS ();
71
- #endif
72
-
78
+ #else
73
79
char * skeleton;
74
80
char * locale;
75
81
size_t locale_len;
@@ -133,10 +139,15 @@ U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, createFromSkeleton)
133
139
RANGEFORMATTER_OBJECT (php_intl_numberrangeformatter_fetch_object (obj)) = nrf;
134
140
135
141
RETURN_OBJ (obj);
142
+ #endif
136
143
}
137
144
138
145
U_CFUNC PHP_METHOD (IntlNumberRangeFormatter, format)
139
146
{
147
+ #if U_ICU_VERSION_MAJOR_NUM < 63
148
+ zend_throw_error (NULL , " IntlNumberRangeFormatter is not available in ICU 62 and earlier" );
149
+ RETURN_THROWS ();
150
+ #else
140
151
zval *start;
141
152
zval *end;
142
153
@@ -169,6 +180,7 @@ U_CFUNC PHP_METHOD(IntlNumberRangeFormatter, format)
169
180
}
170
181
171
182
RETVAL_NEW_STR (ret);
183
+ #endif
172
184
}
173
185
174
186
U_CFUNC PHP_METHOD (IntlNumberRangeFormatter, getErrorCode)
0 commit comments