Make ICU build with Clang.
BUG=74018
TEST=ICU builds with Clang and -Wsign-compare turned on.
TBR=thakis
Review URL: http://codereview.chromium.org/6578023
git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/icu46@75916 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/README.chromium b/README.chromium
index 0cdd2fe..49ec3a4 100644
--- a/README.chromium
+++ b/README.chromium
@@ -99,6 +99,7 @@
To remove some data files we don't use and cut down the data size.
- patches/data.build.win.patch :
Windows-only data build patch. Add a new target DATALIB to makedata.mak
+ - patches/clang.patch: To build with Clang.
- add an empty file (stubdatabuilt.txt) to source/stubdata
9. Pre-built data libraries are checked in.
diff --git a/patches/clang.patch b/patches/clang.patch
new file mode 100644
index 0000000..f26877d
--- /dev/null
+++ b/patches/clang.patch
@@ -0,0 +1,13 @@
+Index: common/unicode/unistr.h
+===================================================================
+--- common/unicode/unistr.h (revision 75773)
++++ common/unicode/unistr.h (working copy)
+@@ -4089,7 +4089,7 @@
+ #if defined(__GNUC__)
+ // Ticket #7039: Clip length to the maximum valid length to the end of addressable memory given the starting address
+ // This is only an issue when using GCC and certain optimizations are turned on.
+- return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - UINT32_MAX) ? (((char*)UINT32_MAX) - dst) : UINT32_MAX) : 0, codepage);
++ return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - UINT32_MAX) ? static_cast<unsigned int>((((char*)UINT32_MAX) - dst)) : UINT32_MAX) : 0, codepage);
+ #else
+ return extract(start, _length, dst, dst!=0 ? 0xffffffff : 0, codepage);
+ #endif
diff --git a/public/common/unicode/unistr.h b/public/common/unicode/unistr.h
index 4fc180f..57ea346 100644
--- a/public/common/unicode/unistr.h
+++ b/public/common/unicode/unistr.h
@@ -4089,7 +4089,7 @@
#if defined(__GNUC__)
// Ticket #7039: Clip length to the maximum valid length to the end of addressable memory given the starting address
// This is only an issue when using GCC and certain optimizations are turned on.
- return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - UINT32_MAX) ? (((char*)UINT32_MAX) - dst) : UINT32_MAX) : 0, codepage);
+ return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - UINT32_MAX) ? static_cast<unsigned int>((((char*)UINT32_MAX) - dst)) : UINT32_MAX) : 0, codepage);
#else
return extract(start, _length, dst, dst!=0 ? 0xffffffff : 0, codepage);
#endif