forwarded 628584 https://bugzilla.osafoundation.org/show_bug.cgi?id=13022
tags 628584 + fixed-upstream patch
thanks
* Jakub Wilk <[email protected]>, 2011-05-30, 15:06:
| format.cpp:731:5: error: 'EStyle' is not a member of 'icu_48::TimeUnitFormat'
I attached the patch that was applied upstream.
--
Jakub Wilk
Index: pyicu/format.cpp
===================================================================
--- pyicu/format.cpp (revision 176)
+++ pyicu/format.cpp (revision 177)
@@ -31,6 +31,10 @@
#include "dateformat.h"
#include "numberformat.h"
+#if U_ICU_VERSION_HEX >= 0x04080000
+ DECLARE_CONSTANTS_TYPE(UTimeUnitFormatStyle);
+#endif
+
/* FieldPosition */
class t_fieldposition : public _wrapper {
@@ -728,7 +732,11 @@
static int t_timeunitformat_init(t_timeunitformat *self,
PyObject *args, PyObject *kwds)
{
+#if U_ICU_VERSION_HEX >= 0x04080000
+ UTimeUnitFormatStyle style;
+#else
TimeUnitFormat::EStyle style;
+#endif
Locale *locale;
switch (PyTuple_Size(args)) {
@@ -1659,8 +1667,13 @@
INSTALL_STATIC_INT(FieldPosition, DONT_CARE);
-#if U_ICU_VERSION_HEX >= 0x04020000
+#if U_ICU_VERSION_HEX >= 0x04020000 && U_ICU_VERSION_HEX < 0x04080000
INSTALL_STATIC_INT(TimeUnitFormat, kFull);
INSTALL_STATIC_INT(TimeUnitFormat, kAbbreviate);
#endif
+#if U_ICU_VERSION_HEX >= 0x04080000
+ INSTALL_CONSTANTS_TYPE(UTimeUnitFormatStyle, m);
+ INSTALL_ENUM(UTimeUnitFormatStyle, "FULL", UTMUTFMT_FULL_STYLE);
+ INSTALL_ENUM(UTimeUnitFormatStyle, "ABBREVIATED", UTMUTFMT_ABBREVIATED_STYLE);
+#endif
}
Index: pyicu/numberformat.cpp
===================================================================
--- pyicu/numberformat.cpp (revision 176)
+++ pyicu/numberformat.cpp (revision 177)
@@ -30,6 +30,10 @@
#include "numberformat.h"
#include "macros.h"
+#if U_ICU_VERSION_HEX >= 0x04080000
+ DECLARE_CONSTANTS_TYPE(UCurrencySpacing);
+#endif
+
/* DecimalFormatSymbols */
class t_decimalformatsymbols : public _wrapper {
@@ -494,7 +498,11 @@
static PyObject *t_decimalformatsymbols_getPatternForCurrencySpacing(t_decimalformatsymbols *self, PyObject *args)
{
+#if U_ICU_VERSION_HEX >= 0x04080000
+ UCurrencySpacing type;
+#else
DecimalFormatSymbols::ECurrencySpacing type;
+#endif
UBool beforeCurrency;
if (!parseArgs(args, "ib", &type, &beforeCurrency))
@@ -510,7 +518,11 @@
static PyObject *t_decimalformatsymbols_setPatternForCurrencySpacing(t_decimalformatsymbols *self, PyObject *args)
{
UnicodeString *u, _u;
+#if U_ICU_VERSION_HEX >= 0x04080000
+ UCurrencySpacing type;
+#else
DecimalFormatSymbols::ECurrencySpacing type;
+#endif
UBool beforeCurrency;
if (!parseArgs(args, "ibS", &type, &beforeCurrency, &u, &_u))
@@ -2278,12 +2290,18 @@
INSTALL_STATIC_INT(DecimalFormatSymbols, kNaNSymbol);
INSTALL_STATIC_INT(DecimalFormatSymbols, kSignificantDigitSymbol);
-#if U_ICU_VERSION_HEX >= 0x04020000
+#if U_ICU_VERSION_HEX >= 0x04020000 && U_ICU_VERSION_HEX < 0x04080000
INSTALL_STATIC_INT(DecimalFormatSymbols, kCurrencyMatch);
INSTALL_STATIC_INT(DecimalFormatSymbols, kSurroundingMatch);
INSTALL_STATIC_INT(DecimalFormatSymbols, kInsert);
INSTALL_STATIC_INT(DecimalFormatSymbols, kCurrencySpacingCount);
#endif
+#if U_ICU_VERSION_HEX >= 0x04080000
+ INSTALL_CONSTANTS_TYPE(UCurrencySpacing, m);
+ INSTALL_ENUM(UCurrencySpacing, "MATCH", UNUM_CURRENCY_MATCH);
+ INSTALL_ENUM(UCurrencySpacing, "SURROUNDING_MATCH", UNUM_CURRENCY_SURROUNDING_MATCH);
+ INSTALL_ENUM(UCurrencySpacing, "INSERT", UNUM_CURRENCY_INSERT);
+#endif
INSTALL_STATIC_INT(NumberFormat, kIntegerField);
INSTALL_STATIC_INT(NumberFormat, kFractionField);
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team