Bug 1838113 - Don't build the unused myopen function. r=masayuki, a=dmeehan

Clang-trunk changed libc++ in a way that breaks fstream support in WASI,
which prevents building the myopen function in csutil.cxx, but the
function is actually unused.

Differential Revision: https://phabricator.services.mozilla.com/D180759
This commit is contained in:
Mike Hommey 2023-06-13 04:08:31 +00:00
parent 6935425afb
commit 024b7133d7
3 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,20 @@
diff --git a/extensions/spellcheck/hunspell/src/csutil.cxx b/extensions/spellcheck/hunspell/src/csutil.cxx
index 48e58ff4b2677..39a54d38023c8 100644
--- a/extensions/spellcheck/hunspell/src/csutil.cxx
+++ b/extensions/spellcheck/hunspell/src/csutil.cxx
@@ -108,6 +108,7 @@ static struct unicode_info2* utf_tbl = NULL;
static int utf_tbl_count =
0; // utf_tbl can be used by multiple Hunspell instances
+#ifndef MOZILLA_CLIENT
void myopen(std::ifstream& stream, const char* path, std::ios_base::openmode mode)
{
#if defined(_WIN32) && defined(_MSC_VER)
@@ -127,6 +128,7 @@ void myopen(std::ifstream& stream, const char* path, std::ios_base::openmode mod
#endif
stream.open(path, mode);
}
+#endif
std::string& u16_u8(std::string& dest, const std::vector<w_char>& src) {
dest.clear();

View File

@ -108,6 +108,7 @@ static struct unicode_info2* utf_tbl = NULL;
static int utf_tbl_count =
0; // utf_tbl can be used by multiple Hunspell instances
#ifndef MOZILLA_CLIENT
void myopen(std::ifstream& stream, const char* path, std::ios_base::openmode mode)
{
#if defined(_WIN32) && defined(_MSC_VER)
@ -127,6 +128,7 @@ void myopen(std::ifstream& stream, const char* path, std::ios_base::openmode mod
#endif
stream.open(path, mode);
}
#endif
std::string& u16_u8(std::string& dest, const std::vector<w_char>& src) {
dest.clear();

View File

@ -31,3 +31,4 @@ cd ${hunspell_dir}/src
patch -p5 < ../patches/bug1410214.patch
patch -p5 < ../patches/bug1653659.patch
patch -p5 < ../patches/bug1739761.patch
patch -p5 < ../patches/bug1838113.patch