summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-01 13:26:38 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-10-02 08:18:41 +0200
commit4d45df2632dddde3d8e34315c8ee76575587a62a (patch)
tree5165240da3b794cb8b110660f417a2355eb32ec9 /external
parentd820136dab6271dd591842002b2591e041801cf7 (diff)
external/icu: Fix "error: explicit instantiation of 'atomic' not in...
...a namespace enclosing 'std'" (clang-cl). (Upstream <https://github.com/ unicode-org/icu/commit/5a34bfb1516a6719b5f470063c6be2f47446f0b2> "ICU-20209 Fix build failures on Windows with std::atomic not in enclo…" covers more things, so just include here what is absolutely necessary for our needs. Change-Id: I10e61b24a5d73b372bfd719d97fc9678029dc205 Reviewed-on: https://gerrit.libreoffice.org/79953 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'external')
-rw-r--r--external/icu/UnpackedTarball_icu.mk4
-rw-r--r--external/icu/clang-cl.patch37
2 files changed, 41 insertions, 0 deletions
diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index 9e5f7974a700..d8a16e0e3777 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -21,6 +21,9 @@ $(eval $(call gb_UnpackedTarball_set_pre_action,icu,\
$(eval $(call gb_UnpackedTarball_set_patchlevel,icu,0))
+# * external/icu/clang-cl.patch is covered by upstream
+# <https://github.com/unicode-org/icu/commit/5a34bfb1516a6719b5f470063c6be2f47446f0b2> "ICU-20209
+# Fix build failures on Windows with std::atomic not in enclo…":
$(eval $(call gb_UnpackedTarball_add_patches,icu,\
external/icu/icu4c-build.patch.1 \
external/icu/icu4c-aix.patch.1 \
@@ -39,6 +42,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
external/icu/gcc9.patch \
external/icu/char8_t.patch \
external/icu/CVE-2018-18928.patch.2 \
+ external/icu/clang-cl.patch \
))
$(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict))
diff --git a/external/icu/clang-cl.patch b/external/icu/clang-cl.patch
new file mode 100644
index 000000000000..83e7baecf266
--- /dev/null
+++ b/external/icu/clang-cl.patch
@@ -0,0 +1,37 @@
+--- source/common/umutex.h
++++ source/common/umutex.h
+@@ -54,15 +54,15 @@
+
+ #include <atomic>
+
+-U_NAMESPACE_BEGIN
+-
+ // Export an explicit template instantiation of std::atomic<int32_t>.
+ // When building DLLs for Windows this is required as it is used as a data member of the exported SharedObject class.
+ // See digitlst.h, pluralaffix.h, datefmt.h, and others for similar examples.
+ #if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
+ template struct U_COMMON_API std::atomic<int32_t>;
+ #endif
+
++U_NAMESPACE_BEGIN
++
+ typedef std::atomic<int32_t> u_atomic_int32_t;
+ #define ATOMIC_INT32_T_INITIALIZER(val) ATOMIC_VAR_INIT(val)
+
+--- source/i18n/unicode/numberrangeformatter.h
++++ source/i18n/unicode/numberrangeformatter.h
+@@ -186,7 +186,13 @@
+ * (When building DLLs for Windows this is required.)
+ */
+ #if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN && !defined(U_IN_DOXYGEN)
+-template struct U_I18N_API std::atomic<impl::NumberRangeFormatterImpl*>;
++} // namespace number
++U_NAMESPACE_END
++
++template struct U_I18N_API std::atomic< U_NAMESPACE_QUALIFIER number::impl::NumberRangeFormatterImpl*>;
++
++U_NAMESPACE_BEGIN
++namespace number { // icu::number
+ #endif
+ /** \endcond */
+