[haiku-commits] haiku: hrev49161 - headers/os/locale src/kits/locale

  • From: jerome.duval@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 10 May 2015 22:06:58 +0200 (CEST)

hrev49161 adds 1 changeset to branch 'master'
old head: 87af13952cadba1205a1f05090ba8b6f1eead34f
new head: 73de58376ac8f983ae64a643e01ec5bf047208d2
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=73de58376ac8+%5E87af13952cad

----------------------------------------------------------------------------

73de58376ac8: 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.

[ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision: hrev49161
Commit: 73de58376ac8f983ae64a643e01ec5bf047208d2
URL: http://cgit.haiku-os.org/haiku/commit/?id=73de58376ac8
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Sun May 10 19:13:59 2015 UTC

Ticket: https://dev.haiku-os.org/ticket/12057

----------------------------------------------------------------------------

27 files changed, 69 insertions(+), 25 deletions(-)
build/jam/repositories/HaikuPorts/x86_64 | 4 ++--
headers/os/locale/Collator.h | 7 +++++--
headers/os/locale/Country.h | 7 +++++--
headers/os/locale/DateFormat.h | 7 +++++--
headers/os/locale/DateTimeFormat.h | 2 +-
headers/os/locale/DurationFormat.h | 7 +++++--
headers/os/locale/FormattingConventions.h | 7 +++++--
headers/os/locale/Language.h | 7 +++++--
headers/os/locale/MessageFormat.h | 9 ++++++---
headers/os/locale/TimeFormat.h | 2 +-
headers/os/locale/TimeUnitFormat.h | 7 +++++--
headers/os/locale/TimeZone.h | 9 ++++++---
src/kits/locale/Collator.cpp | 4 +++-
src/kits/locale/Country.cpp | 1 +
src/kits/locale/DateFormat.cpp | 1 +
src/kits/locale/DateTimeFormat.cpp | 1 +
src/kits/locale/DurationFormat.cpp | 1 +
src/kits/locale/FormattingConventions.cpp | 1 +
src/kits/locale/Language.cpp | 1 +
src/kits/locale/LocaleRoster.cpp | 1 +
src/kits/locale/LocaleRosterData.cpp | 1 +
src/kits/locale/MessageFormat.cpp | 2 ++
src/kits/locale/NumberFormat.cpp | 1 +
src/kits/locale/TimeFormat.cpp | 1 +
src/kits/locale/TimeUnitFormat.cpp | 1 +
src/kits/locale/TimeZone.cpp | 1 +
src/preferences/time/ZoneView.cpp | 1 +

----------------------------------------------------------------------------

diff --git a/build/jam/repositories/HaikuPorts/x86_64
b/build/jam/repositories/HaikuPorts/x86_64
index 631649e..1beb244 100644
--- a/build/jam/repositories/HaikuPorts/x86_64
+++ b/build/jam/repositories/HaikuPorts/x86_64
@@ -97,8 +97,8 @@ RemotePackageRepository HaikuPorts
harfbuzz_devel-0.9.39-1
help2man-1.44.1-1
htmldoc-1.8.27-3
- icu-55.1-2
- icu_devel-55.1-2
+ icu-55.1-3
+ icu_devel-55.1-3
icu54-54.1-1
icu54_devel-54.1-1
intltool-0.40.6-4
diff --git a/headers/os/locale/Collator.h b/headers/os/locale/Collator.h
index 861ccfe..58afa69 100644
--- a/headers/os/locale/Collator.h
+++ b/headers/os/locale/Collator.h
@@ -10,7 +10,10 @@
#include <SupportDefs.h>


-namespace icu {
+#ifndef U_ICU_NAMESPACE
+ #define U_ICU_NAMESPACE icu
+#endif
+namespace U_ICU_NAMESPACE {
class Collator;
};

@@ -73,7 +76,7 @@ public:
private:
status_t _SetStrength(int8
strength) const;

- mutable icu::Collator* fICUCollator;
+ mutable U_ICU_NAMESPACE::Collator* fICUCollator;
int8 fDefaultStrength;
bool fIgnorePunctuation;
};
diff --git a/headers/os/locale/Country.h b/headers/os/locale/Country.h
index e8e9c92..681910e 100644
--- a/headers/os/locale/Country.h
+++ b/headers/os/locale/Country.h
@@ -16,7 +16,10 @@ class BBitmap;
class BLanguage;
class BMessage;

-namespace icu {
+#ifndef U_ICU_NAMESPACE
+ #define U_ICU_NAMESPACE icu
+#endif
+namespace U_ICU_NAMESPACE {
class DateFormat;
class Locale;
}
@@ -45,7 +48,7 @@ public:
private:
friend class Private;

- icu::Locale* fICULocale;
+ U_ICU_NAMESPACE::Locale* fICULocale;
};


diff --git a/headers/os/locale/DateFormat.h b/headers/os/locale/DateFormat.h
index 1eee1e8..76a0567 100644
--- a/headers/os/locale/DateFormat.h
+++ b/headers/os/locale/DateFormat.h
@@ -14,7 +14,10 @@
#include <Locker.h>


-namespace icu {
+#ifndef U_ICU_NAMESPACE
+ #define U_ICU_NAMESPACE icu
+#endif
+namespace U_ICU_NAMESPACE {
class DateFormat;
}

@@ -76,7 +79,7 @@ public:
BDate&
output);

private:
- icu::DateFormat* _CreateDateFormatter(
+ U_ICU_NAMESPACE::DateFormat* _CreateDateFormatter(
const
BDateFormatStyle style) const;

};
diff --git a/headers/os/locale/DateTimeFormat.h
b/headers/os/locale/DateTimeFormat.h
index b7916cf..5a0e3a0 100644
--- a/headers/os/locale/DateTimeFormat.h
+++ b/headers/os/locale/DateTimeFormat.h
@@ -53,7 +53,7 @@ public:
const
BTimeZone* timeZone = NULL) const;

private:
- icu::DateFormat* _CreateDateTimeFormatter(
+ U_ICU_NAMESPACE::DateFormat*
_CreateDateTimeFormatter(
const
BString& format) const;
};

diff --git a/headers/os/locale/DurationFormat.h
b/headers/os/locale/DurationFormat.h
index d1f226e..9a529ec 100644
--- a/headers/os/locale/DurationFormat.h
+++ b/headers/os/locale/DurationFormat.h
@@ -14,7 +14,10 @@

class BTimeZone;

-namespace icu {
+#ifndef U_ICU_NAMESPACE
+ #define U_ICU_NAMESPACE icu
+#endif
+namespace U_ICU_NAMESPACE {
class GregorianCalendar;
}

@@ -43,7 +46,7 @@ public:
private:
BString fSeparator;
BTimeUnitFormat fTimeUnitFormat;
- icu::GregorianCalendar* fCalendar;
+ U_ICU_NAMESPACE::GregorianCalendar* fCalendar;
};


diff --git a/headers/os/locale/FormattingConventions.h
b/headers/os/locale/FormattingConventions.h
index b526ef3..9a888f8 100644
--- a/headers/os/locale/FormattingConventions.h
+++ b/headers/os/locale/FormattingConventions.h
@@ -17,7 +17,10 @@ class BBitmap;
class BLanguage;
class BMessage;

-namespace icu {
+#ifndef U_ICU_NAMESPACE
+ #define U_ICU_NAMESPACE icu
+#endif
+namespace U_ICU_NAMESPACE {
class DateFormat;
class Locale;
}
@@ -137,7 +140,7 @@ private:

bool
fUseStringsFromPreferredLanguage;

- icu::Locale* fICULocale;
+ U_ICU_NAMESPACE::Locale* fICULocale;
};


diff --git a/headers/os/locale/Language.h b/headers/os/locale/Language.h
index 133e798..6f1136e 100644
--- a/headers/os/locale/Language.h
+++ b/headers/os/locale/Language.h
@@ -15,7 +15,10 @@ class BBitmap;

// We must not include the icu headers in there as it could mess up binary
// compatibility.
-namespace icu {
+#ifndef U_ICU_NAMESPACE
+ #define U_ICU_NAMESPACE icu
+#endif
+namespace U_ICU_NAMESPACE {
class Locale;
}

@@ -64,7 +67,7 @@ private:
friend class Private;

uint8 fDirection;
- icu::Locale* fICULocale;
+ U_ICU_NAMESPACE::Locale* fICULocale;
};


diff --git a/headers/os/locale/MessageFormat.h
b/headers/os/locale/MessageFormat.h
index eeaf978..38fb205 100644
--- a/headers/os/locale/MessageFormat.h
+++ b/headers/os/locale/MessageFormat.h
@@ -13,7 +13,10 @@
#include <Format.h>


-namespace icu {
+#ifndef U_ICU_NAMESPACE
+ #define U_ICU_NAMESPACE icu
+#endif
+namespace U_ICU_NAMESPACE {
class MessageFormat;
class UnicodeString;
}
@@ -31,10 +34,10 @@ public:
status_t Format(BString& buffer,
const int64 arg) const;

private:
- status_t _Initialize(const
icu::UnicodeString&);
+ status_t _Initialize(const
U_ICU_NAMESPACE::UnicodeString&);

private:
- icu::MessageFormat* fFormatter;
+ U_ICU_NAMESPACE::MessageFormat* fFormatter;
};


diff --git a/headers/os/locale/TimeFormat.h b/headers/os/locale/TimeFormat.h
index 9a1dc04..152b872 100644
--- a/headers/os/locale/TimeFormat.h
+++ b/headers/os/locale/TimeFormat.h
@@ -48,7 +48,7 @@ public:

BPrivate::BTime& output);

private:
- icu::DateFormat* _CreateTimeFormatter(
+ U_ICU_NAMESPACE::DateFormat* _CreateTimeFormatter(
const
BTimeFormatStyle style) const;
};

diff --git a/headers/os/locale/TimeUnitFormat.h
b/headers/os/locale/TimeUnitFormat.h
index d729efe..447284b 100644
--- a/headers/os/locale/TimeUnitFormat.h
+++ b/headers/os/locale/TimeUnitFormat.h
@@ -12,7 +12,10 @@

class BString;

-namespace icu {
+#ifndef U_ICU_NAMESPACE
+ #define U_ICU_NAMESPACE icu
+#endif
+namespace U_ICU_NAMESPACE {
class TimeUnitFormat;
}

@@ -53,7 +56,7 @@ public:
) const;

private:
- icu::TimeUnitFormat* fFormatter;
+ U_ICU_NAMESPACE::TimeUnitFormat* fFormatter;
};


diff --git a/headers/os/locale/TimeZone.h b/headers/os/locale/TimeZone.h
index ced9e90..f58f99d 100644
--- a/headers/os/locale/TimeZone.h
+++ b/headers/os/locale/TimeZone.h
@@ -9,7 +9,10 @@
#include <String.h>


-namespace icu {
+#ifndef U_ICU_NAMESPACE
+ #define U_ICU_NAMESPACE icu
+#endif
+namespace U_ICU_NAMESPACE {
class Locale;
class TimeZone;
}
@@ -46,8 +49,8 @@ public:
private:
friend class Private;

- icu::TimeZone* fICUTimeZone;
- icu::Locale* fICULocale;
+ U_ICU_NAMESPACE::TimeZone* fICUTimeZone;
+ U_ICU_NAMESPACE::Locale* fICULocale;
status_t fInitStatus;

mutable uint32 fInitializedFields;
diff --git a/src/kits/locale/Collator.cpp b/src/kits/locale/Collator.cpp
index 47d7f55..cfb0f94 100644
--- a/src/kits/locale/Collator.cpp
+++ b/src/kits/locale/Collator.cpp
@@ -5,13 +5,15 @@
*/


+#include <unicode/uversion.h>
+#include <Collator.h>
+
#include <ctype.h>
#include <stdlib.h>

#include <new>
#include <typeinfo>

-#include <Collator.h>
#include <UnicodeChar.h>
#include <String.h>
#include <Message.h>
diff --git a/src/kits/locale/Country.cpp b/src/kits/locale/Country.cpp
index 8b67c9e..e95711d 100644
--- a/src/kits/locale/Country.cpp
+++ b/src/kits/locale/Country.cpp
@@ -5,6 +5,7 @@
*/


+#include <unicode/uversion.h>
#include <Country.h>

#include <AutoDeleter.h>
diff --git a/src/kits/locale/DateFormat.cpp b/src/kits/locale/DateFormat.cpp
index ae067ab..6542c3b 100644
--- a/src/kits/locale/DateFormat.cpp
+++ b/src/kits/locale/DateFormat.cpp
@@ -7,6 +7,7 @@
* Adrien Desutugues <pulkomandy@xxxxxxxxxxxxx>
*/

+#include <unicode/uversion.h>
#include <DateFormat.h>

#include <AutoDeleter.h>
diff --git a/src/kits/locale/DateTimeFormat.cpp
b/src/kits/locale/DateTimeFormat.cpp
index 4e856ce..7172257 100644
--- a/src/kits/locale/DateTimeFormat.cpp
+++ b/src/kits/locale/DateTimeFormat.cpp
@@ -6,6 +6,7 @@
* Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
*/

+#include <unicode/uversion.h>
#include <DateTimeFormat.h>

#include <AutoDeleter.h>
diff --git a/src/kits/locale/DurationFormat.cpp
b/src/kits/locale/DurationFormat.cpp
index 1d11ced..9536480 100644
--- a/src/kits/locale/DurationFormat.cpp
+++ b/src/kits/locale/DurationFormat.cpp
@@ -7,6 +7,7 @@
*/


+#include <unicode/uversion.h>
#include <DurationFormat.h>

#include <new>
diff --git a/src/kits/locale/FormattingConventions.cpp
b/src/kits/locale/FormattingConventions.cpp
index 7535300..0ae512f 100644
--- a/src/kits/locale/FormattingConventions.cpp
+++ b/src/kits/locale/FormattingConventions.cpp
@@ -6,6 +6,7 @@
*/


+#include <unicode/uversion.h>
#include <FormattingConventions.h>

#include <AutoDeleter.h>
diff --git a/src/kits/locale/Language.cpp b/src/kits/locale/Language.cpp
index 1b140c7..047f582 100644
--- a/src/kits/locale/Language.cpp
+++ b/src/kits/locale/Language.cpp
@@ -4,6 +4,7 @@
*/


+#include <unicode/uversion.h>
#include <Language.h>

#include <stdlib.h>
diff --git a/src/kits/locale/LocaleRoster.cpp b/src/kits/locale/LocaleRoster.cpp
index 748c988..1770960 100644
--- a/src/kits/locale/LocaleRoster.cpp
+++ b/src/kits/locale/LocaleRoster.cpp
@@ -8,6 +8,7 @@
*/


+#include <unicode/uversion.h>
#include <LocaleRoster.h>

#include <assert.h>
diff --git a/src/kits/locale/LocaleRosterData.cpp
b/src/kits/locale/LocaleRosterData.cpp
index 2efbc99..b1f9dfd 100644
--- a/src/kits/locale/LocaleRosterData.cpp
+++ b/src/kits/locale/LocaleRosterData.cpp
@@ -8,6 +8,7 @@
*/


+#include <unicode/uversion.h>
#include <LocaleRosterData.h>

#include <Autolock.h>
diff --git a/src/kits/locale/MessageFormat.cpp
b/src/kits/locale/MessageFormat.cpp
index 4c66e5a..274d4ac 100644
--- a/src/kits/locale/MessageFormat.cpp
+++ b/src/kits/locale/MessageFormat.cpp
@@ -6,6 +6,8 @@
* Adrien Destugues, pulkomandy@xxxxxxxxxxxxx
* John Scipione, jscipione@xxxxxxxxx
*/
+
+#include <unicode/uversion.h>
#include <MessageFormat.h>

#include <Autolock.h>
diff --git a/src/kits/locale/NumberFormat.cpp b/src/kits/locale/NumberFormat.cpp
index f6368af..fefd4a3 100644
--- a/src/kits/locale/NumberFormat.cpp
+++ b/src/kits/locale/NumberFormat.cpp
@@ -6,6 +6,7 @@
*/


+#include <unicode/uversion.h>
#include <NumberFormat.h>

#include <AutoDeleter.h>
diff --git a/src/kits/locale/TimeFormat.cpp b/src/kits/locale/TimeFormat.cpp
index 4e258cb..55cc534 100644
--- a/src/kits/locale/TimeFormat.cpp
+++ b/src/kits/locale/TimeFormat.cpp
@@ -6,6 +6,7 @@
* Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
*/

+#include <unicode/uversion.h>
#include <TimeFormat.h>

#include <AutoDeleter.h>
diff --git a/src/kits/locale/TimeUnitFormat.cpp
b/src/kits/locale/TimeUnitFormat.cpp
index de125a7..61a8ba5 100644
--- a/src/kits/locale/TimeUnitFormat.cpp
+++ b/src/kits/locale/TimeUnitFormat.cpp
@@ -8,6 +8,7 @@
*/


+#include <unicode/uversion.h>
#include <TimeUnitFormat.h>

#include <new>
diff --git a/src/kits/locale/TimeZone.cpp b/src/kits/locale/TimeZone.cpp
index 86258e3..d4860c6 100644
--- a/src/kits/locale/TimeZone.cpp
+++ b/src/kits/locale/TimeZone.cpp
@@ -8,6 +8,7 @@
*/


+#include <unicode/uversion.h>
#include <TimeZone.h>

#include <new>
diff --git a/src/preferences/time/ZoneView.cpp
b/src/preferences/time/ZoneView.cpp
index 03ca2c9..d62bbef 100644
--- a/src/preferences/time/ZoneView.cpp
+++ b/src/preferences/time/ZoneView.cpp
@@ -13,6 +13,7 @@
*/


+#include <unicode/uversion.h>
#include "ZoneView.h"

#include <stdlib.h>


Other related posts: