Bug 1028945 - Allow building ICU with clang-cl; r=Waldo
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 24 Jun 2014 07:19:45 -0700
changeset 190545 a2f87c54b7c87497738317bdc4ac1cda5f9bb5b5
parent 190544 5307410e3a3b11729a4699a5e8e8f8919a59f49f
child 190546 5ab82e6a9bc40c2baf2b933e1c72f89b35f3579b
push id27009
push userkwierso@gmail.com
push dateWed, 25 Jun 2014 01:13:54 +0000
treeherdermozilla-central@a19e0434ea52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1028945
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1028945 - Allow building ICU with clang-cl; r=Waldo
intl/icu-patches/clang-cl.diff
intl/icu/source/common/umutex.cpp
intl/update-icu.sh
new file mode 100644
--- /dev/null
+++ b/intl/icu-patches/clang-cl.diff
@@ -0,0 +1,23 @@
+diff --git a/intl/icu/source/common/umutex.cpp b/intl/icu/source/common/umutex.cpp
+index 8f55208..281c370 100644
+--- a/intl/icu/source/common/umutex.cpp
++++ b/intl/icu/source/common/umutex.cpp
+@@ -64,17 +64,17 @@ static UMutex   globalMutex = U_MUTEX_INITIALIZER;
+ //   the caller needs to call the Init function.
+ //
+ 
+ U_NAMESPACE_BEGIN
+ 
+ U_COMMON_API UBool U_EXPORT2 umtx_initImplPreInit(UInitOnce &uio) {
+     for (;;) {
+         int32_t previousState = InterlockedCompareExchange(
+-#if (U_PLATFORM == U_PF_MINGW) || (U_PLATFORM == U_PF_CYGWIN)
++#if (U_PLATFORM == U_PF_MINGW) || (U_PLATFORM == U_PF_CYGWIN) || defined(__clang__)
+            (LONG volatile *) // this is the type given in the API doc for this function.
+ #endif
+             &uio.fState,  //  Destination
+             1,            //  Exchange Value
+             0);           //  Compare value
+ 
+         if (previousState == 0) {
+             return true;   // Caller will next call the init function.
--- a/intl/icu/source/common/umutex.cpp
+++ b/intl/icu/source/common/umutex.cpp
@@ -64,17 +64,17 @@ static UMutex   globalMutex = U_MUTEX_IN
 //   the caller needs to call the Init function.
 //
 
 U_NAMESPACE_BEGIN
 
 U_COMMON_API UBool U_EXPORT2 umtx_initImplPreInit(UInitOnce &uio) {
     for (;;) {
         int32_t previousState = InterlockedCompareExchange(
-#if (U_PLATFORM == U_PF_MINGW) || (U_PLATFORM == U_PF_CYGWIN)
+#if (U_PLATFORM == U_PF_MINGW) || (U_PLATFORM == U_PF_CYGWIN) || defined(__clang__)
            (LONG volatile *) // this is the type given in the API doc for this function.
 #endif
             &uio.fState,  //  Destination
             1,            //  Exchange Value
             0);           //  Compare value
 
         if (previousState == 0) {
             return true;   // Caller will next call the init function.
--- a/intl/update-icu.sh
+++ b/intl/update-icu.sh
@@ -51,10 +51,11 @@ rm ${icu_dir}/source/data/translit/*
 svn info $1 | grep -v '^Revision: [[:digit:]]\+$' > ${icu_dir}/SVN-INFO
 
 patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-724533
 patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-899722-4
 patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-915735
 patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/genrb-omitCollationRules.diff
 patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/qualify-uinitonce-windows.diff
 patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/suppress-warnings.diff
+patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/clang-cl.diff
 
 hg addremove ${icu_dir}