summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2022-02-07 12:05:03 +0000
committerMichael Meeks <michael.meeks@collabora.com>2022-02-07 19:44:50 +0100
commit1eab80a0495b2c858a168148bc3a96ab287b5bd2 (patch)
tree4ad5f12a4960fd1c809224a0ed3b3bc612970660 /external
parentc24b04707c5b914bda22d709c2da025c784f5045 (diff)
boost / gettext warning improvement.
std::runtime_exception of: "Invalid or unsupported charset:UTF-8 or UTF-8" is less useful than it could be when spat out from the boost gettext impl. Survive for the next (and probably more useful) exception. Change-Id: Ibeb60b4a34f09f47051844c3e8048f38618d0e05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129566 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'external')
-rw-r--r--external/boost/UnpackedTarball_boost.mk1
-rw-r--r--external/boost/boost.between.warning.patch13
2 files changed, 14 insertions, 0 deletions
diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk
index beb03a436550..1875876f0645 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -16,6 +16,7 @@ boost_patches += boost.6142.warnings.patch.1
boost_patches += boost.utility.Wundef.warnings.patch
boost_patches += boost.noiconv.patch
+boost_patches += boost.between.warning.patch
boost_patches += rtti.patch.0
diff --git a/external/boost/boost.between.warning.patch b/external/boost/boost.between.warning.patch
new file mode 100644
index 000000000000..bb4535708549
--- /dev/null
+++ b/external/boost/boost.between.warning.patch
@@ -0,0 +1,13 @@
+diff -ru boost.orig/boost/libs/locale/src/encoding/codepage.cpp boost/boost/libs/locale/src/encoding/codepage.cpp
+--- foo/misc/boost.orig/libs/locale/src/encoding/codepage.cpp
++++ foo/misc/boost/libs/locale/src/encoding/codepage.cpp
+@@ -58,6 +58,9 @@
+ return cvt->convert(begin,end);
+ #endif
+ #endif
++ // ensures we get a sensible warning in boost's gettext results about a real mismatch.
++ if (to_charset && from_charset && !strcmp(to_charset, from_charset))
++ return std::string(begin, end - begin);
+ throw invalid_charset_error(std::string(to_charset) + " or " + from_charset);
+ }
+