2 ===================================================================
3 --- format.cpp (revision 176)
4 +++ format.cpp (revision 177)
6 #include "dateformat.h"
7 #include "numberformat.h"
9 +#if U_ICU_VERSION_HEX >= 0x04080000
10 + DECLARE_CONSTANTS_TYPE(UTimeUnitFormatStyle);
15 class t_fieldposition : public _wrapper {
17 static int t_timeunitformat_init(t_timeunitformat *self,
18 PyObject *args, PyObject *kwds)
20 +#if U_ICU_VERSION_HEX >= 0x04080000
21 + UTimeUnitFormatStyle style;
23 TimeUnitFormat::EStyle style;
27 switch (PyTuple_Size(args)) {
28 @@ -1659,8 +1667,13 @@
30 INSTALL_STATIC_INT(FieldPosition, DONT_CARE);
32 -#if U_ICU_VERSION_HEX >= 0x04020000
33 +#if U_ICU_VERSION_HEX >= 0x04020000 && U_ICU_VERSION_HEX < 0x04080000
34 INSTALL_STATIC_INT(TimeUnitFormat, kFull);
35 INSTALL_STATIC_INT(TimeUnitFormat, kAbbreviate);
37 +#if U_ICU_VERSION_HEX >= 0x04080000
38 + INSTALL_CONSTANTS_TYPE(UTimeUnitFormatStyle, m);
39 + INSTALL_ENUM(UTimeUnitFormatStyle, "FULL", UTMUTFMT_FULL_STYLE);
40 + INSTALL_ENUM(UTimeUnitFormatStyle, "ABBREVIATED", UTMUTFMT_ABBREVIATED_STYLE);
43 Index: numberformat.cpp
44 ===================================================================
45 --- numberformat.cpp (revision 176)
46 +++ numberformat.cpp (revision 177)
48 #include "numberformat.h"
51 +#if U_ICU_VERSION_HEX >= 0x04080000
52 + DECLARE_CONSTANTS_TYPE(UCurrencySpacing);
55 /* DecimalFormatSymbols */
57 class t_decimalformatsymbols : public _wrapper {
60 static PyObject *t_decimalformatsymbols_getPatternForCurrencySpacing(t_decimalformatsymbols *self, PyObject *args)
62 +#if U_ICU_VERSION_HEX >= 0x04080000
63 + UCurrencySpacing type;
65 DecimalFormatSymbols::ECurrencySpacing type;
69 if (!parseArgs(args, "ib", &type, &beforeCurrency))
71 static PyObject *t_decimalformatsymbols_setPatternForCurrencySpacing(t_decimalformatsymbols *self, PyObject *args)
74 +#if U_ICU_VERSION_HEX >= 0x04080000
75 + UCurrencySpacing type;
77 DecimalFormatSymbols::ECurrencySpacing type;
81 if (!parseArgs(args, "ibS", &type, &beforeCurrency, &u, &_u))
82 @@ -2278,12 +2290,18 @@
83 INSTALL_STATIC_INT(DecimalFormatSymbols, kNaNSymbol);
84 INSTALL_STATIC_INT(DecimalFormatSymbols, kSignificantDigitSymbol);
86 -#if U_ICU_VERSION_HEX >= 0x04020000
87 +#if U_ICU_VERSION_HEX >= 0x04020000 && U_ICU_VERSION_HEX < 0x04080000
88 INSTALL_STATIC_INT(DecimalFormatSymbols, kCurrencyMatch);
89 INSTALL_STATIC_INT(DecimalFormatSymbols, kSurroundingMatch);
90 INSTALL_STATIC_INT(DecimalFormatSymbols, kInsert);
91 INSTALL_STATIC_INT(DecimalFormatSymbols, kCurrencySpacingCount);
93 +#if U_ICU_VERSION_HEX >= 0x04080000
94 + INSTALL_CONSTANTS_TYPE(UCurrencySpacing, m);
95 + INSTALL_ENUM(UCurrencySpacing, "MATCH", UNUM_CURRENCY_MATCH);
96 + INSTALL_ENUM(UCurrencySpacing, "SURROUNDING_MATCH", UNUM_CURRENCY_SURROUNDING_MATCH);
97 + INSTALL_ENUM(UCurrencySpacing, "INSERT", UNUM_CURRENCY_INSERT);
100 INSTALL_STATIC_INT(NumberFormat, kIntegerField);
101 INSTALL_STATIC_INT(NumberFormat, kFractionField);