Update icu x86_64 package with namespace renaming enabled.

"Renaming" means the icu namespace is suffixed with the version number,
atm icu_55. Using "renaming" allows to use two different versions of ICU,
thus easing upgrades. For instance haikuwebkit uses a current version of ICU,
while the system uses a newer one after an upgrade.

* Replace all uses of the icu namespace in our public headers, with a macro
defaulting to icu. As the namespace is only used for private fields pointers,
there should be no impact.
* Locale kit *.cpp have to import the macro from <unicode/uversion.h> *before*
including any locale headers. Ditto for a Time preferences cpp file. This way,
the correct current icu namespace is referenced.
* Fixes bug #12057.
This commit is contained in:
Jérôme Duval
2015-05-10 21:52:36 +02:00
parent 87af13952c
commit 73de58376a
27 changed files with 69 additions and 25 deletions
+2 -2
View File
@@ -97,8 +97,8 @@ RemotePackageRepository HaikuPorts
harfbuzz_devel-0.9.39-1 harfbuzz_devel-0.9.39-1
help2man-1.44.1-1 help2man-1.44.1-1
htmldoc-1.8.27-3 htmldoc-1.8.27-3
icu-55.1-2 icu-55.1-3
icu_devel-55.1-2 icu_devel-55.1-3
icu54-54.1-1 icu54-54.1-1
icu54_devel-54.1-1 icu54_devel-54.1-1
intltool-0.40.6-4 intltool-0.40.6-4
+5 -2
View File
@@ -10,7 +10,10 @@
#include <SupportDefs.h> #include <SupportDefs.h>
namespace icu { #ifndef U_ICU_NAMESPACE
#define U_ICU_NAMESPACE icu
#endif
namespace U_ICU_NAMESPACE {
class Collator; class Collator;
}; };
@@ -73,7 +76,7 @@ public:
private: private:
status_t _SetStrength(int8 strength) const; status_t _SetStrength(int8 strength) const;
mutable icu::Collator* fICUCollator; mutable U_ICU_NAMESPACE::Collator* fICUCollator;
int8 fDefaultStrength; int8 fDefaultStrength;
bool fIgnorePunctuation; bool fIgnorePunctuation;
}; };
+5 -2
View File
@@ -16,7 +16,10 @@ class BBitmap;
class BLanguage; class BLanguage;
class BMessage; class BMessage;
namespace icu { #ifndef U_ICU_NAMESPACE
#define U_ICU_NAMESPACE icu
#endif
namespace U_ICU_NAMESPACE {
class DateFormat; class DateFormat;
class Locale; class Locale;
} }
@@ -45,7 +48,7 @@ public:
private: private:
friend class Private; friend class Private;
icu::Locale* fICULocale; U_ICU_NAMESPACE::Locale* fICULocale;
}; };
+5 -2
View File
@@ -14,7 +14,10 @@
#include <Locker.h> #include <Locker.h>
namespace icu { #ifndef U_ICU_NAMESPACE
#define U_ICU_NAMESPACE icu
#endif
namespace U_ICU_NAMESPACE {
class DateFormat; class DateFormat;
} }
@@ -76,7 +79,7 @@ public:
BDate& output); BDate& output);
private: private:
icu::DateFormat* _CreateDateFormatter( U_ICU_NAMESPACE::DateFormat* _CreateDateFormatter(
const BDateFormatStyle style) const; const BDateFormatStyle style) const;
}; };
+1 -1
View File
@@ -53,7 +53,7 @@ public:
const BTimeZone* timeZone = NULL) const; const BTimeZone* timeZone = NULL) const;
private: private:
icu::DateFormat* _CreateDateTimeFormatter( U_ICU_NAMESPACE::DateFormat* _CreateDateTimeFormatter(
const BString& format) const; const BString& format) const;
}; };
+5 -2
View File
@@ -14,7 +14,10 @@
class BTimeZone; class BTimeZone;
namespace icu { #ifndef U_ICU_NAMESPACE
#define U_ICU_NAMESPACE icu
#endif
namespace U_ICU_NAMESPACE {
class GregorianCalendar; class GregorianCalendar;
} }
@@ -43,7 +46,7 @@ public:
private: private:
BString fSeparator; BString fSeparator;
BTimeUnitFormat fTimeUnitFormat; BTimeUnitFormat fTimeUnitFormat;
icu::GregorianCalendar* fCalendar; U_ICU_NAMESPACE::GregorianCalendar* fCalendar;
}; };
+5 -2
View File
@@ -17,7 +17,10 @@ class BBitmap;
class BLanguage; class BLanguage;
class BMessage; class BMessage;
namespace icu { #ifndef U_ICU_NAMESPACE
#define U_ICU_NAMESPACE icu
#endif
namespace U_ICU_NAMESPACE {
class DateFormat; class DateFormat;
class Locale; class Locale;
} }
@@ -137,7 +140,7 @@ private:
bool fUseStringsFromPreferredLanguage; bool fUseStringsFromPreferredLanguage;
icu::Locale* fICULocale; U_ICU_NAMESPACE::Locale* fICULocale;
}; };
+5 -2
View File
@@ -15,7 +15,10 @@ class BBitmap;
// We must not include the icu headers in there as it could mess up binary // We must not include the icu headers in there as it could mess up binary
// compatibility. // compatibility.
namespace icu { #ifndef U_ICU_NAMESPACE
#define U_ICU_NAMESPACE icu
#endif
namespace U_ICU_NAMESPACE {
class Locale; class Locale;
} }
@@ -64,7 +67,7 @@ private:
friend class Private; friend class Private;
uint8 fDirection; uint8 fDirection;
icu::Locale* fICULocale; U_ICU_NAMESPACE::Locale* fICULocale;
}; };
+6 -3
View File
@@ -13,7 +13,10 @@
#include <Format.h> #include <Format.h>
namespace icu { #ifndef U_ICU_NAMESPACE
#define U_ICU_NAMESPACE icu
#endif
namespace U_ICU_NAMESPACE {
class MessageFormat; class MessageFormat;
class UnicodeString; class UnicodeString;
} }
@@ -31,10 +34,10 @@ public:
status_t Format(BString& buffer, const int64 arg) const; status_t Format(BString& buffer, const int64 arg) const;
private: private:
status_t _Initialize(const icu::UnicodeString&); status_t _Initialize(const U_ICU_NAMESPACE::UnicodeString&);
private: private:
icu::MessageFormat* fFormatter; U_ICU_NAMESPACE::MessageFormat* fFormatter;
}; };
+1 -1
View File
@@ -48,7 +48,7 @@ public:
BPrivate::BTime& output); BPrivate::BTime& output);
private: private:
icu::DateFormat* _CreateTimeFormatter( U_ICU_NAMESPACE::DateFormat* _CreateTimeFormatter(
const BTimeFormatStyle style) const; const BTimeFormatStyle style) const;
}; };
+5 -2
View File
@@ -12,7 +12,10 @@
class BString; class BString;
namespace icu { #ifndef U_ICU_NAMESPACE
#define U_ICU_NAMESPACE icu
#endif
namespace U_ICU_NAMESPACE {
class TimeUnitFormat; class TimeUnitFormat;
} }
@@ -53,7 +56,7 @@ public:
) const; ) const;
private: private:
icu::TimeUnitFormat* fFormatter; U_ICU_NAMESPACE::TimeUnitFormat* fFormatter;
}; };
+6 -3
View File
@@ -9,7 +9,10 @@
#include <String.h> #include <String.h>
namespace icu { #ifndef U_ICU_NAMESPACE
#define U_ICU_NAMESPACE icu
#endif
namespace U_ICU_NAMESPACE {
class Locale; class Locale;
class TimeZone; class TimeZone;
} }
@@ -46,8 +49,8 @@ public:
private: private:
friend class Private; friend class Private;
icu::TimeZone* fICUTimeZone; U_ICU_NAMESPACE::TimeZone* fICUTimeZone;
icu::Locale* fICULocale; U_ICU_NAMESPACE::Locale* fICULocale;
status_t fInitStatus; status_t fInitStatus;
mutable uint32 fInitializedFields; mutable uint32 fInitializedFields;
+3 -1
View File
@@ -5,13 +5,15 @@
*/ */
#include <unicode/uversion.h>
#include <Collator.h>
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <new> #include <new>
#include <typeinfo> #include <typeinfo>
#include <Collator.h>
#include <UnicodeChar.h> #include <UnicodeChar.h>
#include <String.h> #include <String.h>
#include <Message.h> #include <Message.h>
+1
View File
@@ -5,6 +5,7 @@
*/ */
#include <unicode/uversion.h>
#include <Country.h> #include <Country.h>
#include <AutoDeleter.h> #include <AutoDeleter.h>
+1
View File
@@ -7,6 +7,7 @@
* Adrien Desutugues <pulkomandy@pulkomandy.tk> * Adrien Desutugues <pulkomandy@pulkomandy.tk>
*/ */
#include <unicode/uversion.h>
#include <DateFormat.h> #include <DateFormat.h>
#include <AutoDeleter.h> #include <AutoDeleter.h>
+1
View File
@@ -6,6 +6,7 @@
* Oliver Tappe <zooey@hirschkaefer.de> * Oliver Tappe <zooey@hirschkaefer.de>
*/ */
#include <unicode/uversion.h>
#include <DateTimeFormat.h> #include <DateTimeFormat.h>
#include <AutoDeleter.h> #include <AutoDeleter.h>
+1
View File
@@ -7,6 +7,7 @@
*/ */
#include <unicode/uversion.h>
#include <DurationFormat.h> #include <DurationFormat.h>
#include <new> #include <new>
@@ -6,6 +6,7 @@
*/ */
#include <unicode/uversion.h>
#include <FormattingConventions.h> #include <FormattingConventions.h>
#include <AutoDeleter.h> #include <AutoDeleter.h>
+1
View File
@@ -4,6 +4,7 @@
*/ */
#include <unicode/uversion.h>
#include <Language.h> #include <Language.h>
#include <stdlib.h> #include <stdlib.h>
+1
View File
@@ -8,6 +8,7 @@
*/ */
#include <unicode/uversion.h>
#include <LocaleRoster.h> #include <LocaleRoster.h>
#include <assert.h> #include <assert.h>
+1
View File
@@ -8,6 +8,7 @@
*/ */
#include <unicode/uversion.h>
#include <LocaleRosterData.h> #include <LocaleRosterData.h>
#include <Autolock.h> #include <Autolock.h>
+2
View File
@@ -6,6 +6,8 @@
* Adrien Destugues, pulkomandy@pulkomandy.tk * Adrien Destugues, pulkomandy@pulkomandy.tk
* John Scipione, jscipione@gmail.com * John Scipione, jscipione@gmail.com
*/ */
#include <unicode/uversion.h>
#include <MessageFormat.h> #include <MessageFormat.h>
#include <Autolock.h> #include <Autolock.h>
+1
View File
@@ -6,6 +6,7 @@
*/ */
#include <unicode/uversion.h>
#include <NumberFormat.h> #include <NumberFormat.h>
#include <AutoDeleter.h> #include <AutoDeleter.h>
+1
View File
@@ -6,6 +6,7 @@
* Oliver Tappe <zooey@hirschkaefer.de> * Oliver Tappe <zooey@hirschkaefer.de>
*/ */
#include <unicode/uversion.h>
#include <TimeFormat.h> #include <TimeFormat.h>
#include <AutoDeleter.h> #include <AutoDeleter.h>
+1
View File
@@ -8,6 +8,7 @@
*/ */
#include <unicode/uversion.h>
#include <TimeUnitFormat.h> #include <TimeUnitFormat.h>
#include <new> #include <new>
+1
View File
@@ -8,6 +8,7 @@
*/ */
#include <unicode/uversion.h>
#include <TimeZone.h> #include <TimeZone.h>
#include <new> #include <new>
+1
View File
@@ -13,6 +13,7 @@
*/ */
#include <unicode/uversion.h>
#include "ZoneView.h" #include "ZoneView.h"
#include <stdlib.h> #include <stdlib.h>