external/libnumbertext/UnpackedTarball_libnumbertext.mk |    1 
 external/libnumbertext/deprecated.patch.0               |   49 ++++++++++++++++
 2 files changed, 50 insertions(+)

New commits:
commit 3edabf69c20bd8d945d2edf7652e1f9a671905e1
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Fri Jul 1 19:45:19 2022 +0200
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Tue Jul 4 18:28:10 2023 +0200

    external/libnumbertext: Silence -Werror,-Wdeprecated-declarations
    
    ...as seen now with LLVM 15 trunk libc++, which marks the std::codecvt_utf8 
and
    std::wstring_convert functionality, deprecated since C++17, as such
    
(<https://github.com/llvm/llvm-project/commit/3ee9a50a146c585fc92f79e742c538261f98bd4e>
    "[libc++] Implement P0618R0 (Deprecating <codecvt>)")
    
    Change-Id: Id34e3fea540b76591ead8ba3df4c31a71d7b4aaf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136776
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit e37e1a7d2007bd6896027b69271774da2568e6f8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153935
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>

diff --git a/external/libnumbertext/UnpackedTarball_libnumbertext.mk 
b/external/libnumbertext/UnpackedTarball_libnumbertext.mk
index fb88366d5aef..fa8c59b975c8 100644
--- a/external/libnumbertext/UnpackedTarball_libnumbertext.mk
+++ b/external/libnumbertext/UnpackedTarball_libnumbertext.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libnumbertext, \
     external/libnumbertext/MSVCNonBMPBug.patch1 \
     external/libnumbertext/WinUnicodePath.patch1 \
     external/libnumbertext/EmptyString.patch1 \
+    external/libnumbertext/deprecated.patch.0 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/libnumbertext/deprecated.patch.0 
b/external/libnumbertext/deprecated.patch.0
new file mode 100644
index 000000000000..1fe5c214f602
--- /dev/null
+++ b/external/libnumbertext/deprecated.patch.0
@@ -0,0 +1,49 @@
+--- src/Numbertext.cxx
++++ src/Numbertext.cxx
+@@ -41,7 +41,14 @@
+     std::wifstream wif(filename);
+     if (wif.fail())
+         return false;
++#if defined __GNUC__
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
+     wif.imbue(std::locale(std::locale(), new std::codecvt_utf8<wchar_t>));
++#if defined __GNUC__
++#pragma GCC diagnostic pop
++#endif
+     std::wstringstream wss;
+     wss << wif.rdbuf();
+     result = wss.str();
+@@ -122,8 +129,15 @@
+     MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, wstr.get(), nSize);
+     return wstr.get();
+ #elif !defined NUMBERTEXT_BOOST
++#if defined __GNUC__
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
+     typedef std::codecvt_utf8<wchar_t> convert_type;
+     std::wstring_convert<convert_type, wchar_t> converter;
++#if defined __GNUC__
++#pragma GCC diagnostic pop
++#endif
+     return converter.from_bytes( s );
+ #else
+     return ::locale::conv::utf_to_utf<wchar_t>(s.c_str(), s.c_str() + 
s.size());
+@@ -138,8 +152,15 @@
+     WideCharToMultiByte(CP_UTF8, 0, s.c_str(), -1, str.get(), nSize, nullptr, 
nullptr);
+     return str.get();
+ #elif !defined NUMBERTEXT_BOOST
++#if defined __GNUC__
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
+     typedef std::codecvt_utf8<wchar_t> convert_type;
+     std::wstring_convert<convert_type, wchar_t> converter;
++#if defined __GNUC__
++#pragma GCC diagnostic pop
++#endif
+     return converter.to_bytes( s );
+ #else
+     return ::locale::conv::utf_to_utf<char>(s.c_str(), s.c_str() + s.size());

Reply via email to