external/clucene/UnpackedTarball_clucene.mk    |    1 
 external/clucene/patches/ostream-wchar_t.patch |   29 +++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

New commits:
commit 2b4a371c1ae4045678bb8c2d3a76e2a1d7333e4b
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Tue Dec 3 11:44:04 2019 +0100
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Nov 12 13:58:29 2025 +0100

    external/clucene: Adapt to C++20 deleted ostream << for non-plain char types
    
    <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1423r3.html> 
"char8_t
    backward compatibility remediation", as implemented now by 
<https://gcc.gnu.org/
    git/?p=gcc.git;a=commit;h=0c5b35933e5b150df0ab487efb2f11ef5685f713> 
"libstdc++:
    P1423R3 char8_t remediation (2/4)" for -std=c++2a, deletes operator << 
overloads
    that would print a pointer rather than a (presumably expected) string.
    
    So this infoStream output appears to have always been broken (the strings 
use
    TCHAR, which appears to unconditionally be a typedef for wchar_t, see
    workdir/UnpackedTarball/clucene/src/shared/CLucene/clucene-config.h), and
    appears to be just of informative nature, so just simplify it to not try to
    print any problematic parts.
    
    Change-Id: Ie9f8edb03aff461a15718a0c025af57004aba0a9
    Reviewed-on: https://gerrit.libreoffice.org/84320
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 48f845dace0aa7a607914db9febdaf73073ea607)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193853
    Tested-by: allotropia jenkins <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/external/clucene/UnpackedTarball_clucene.mk 
b/external/clucene/UnpackedTarball_clucene.mk
index 19107ae193ab..4befa3f7acda 100644
--- a/external/clucene/UnpackedTarball_clucene.mk
+++ b/external/clucene/UnpackedTarball_clucene.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,clucene,\
        external/clucene/patches/clucene-asan.patch \
        
external/clucene/patches/clucene-mixes-uptemplate-parameter-msvc-14.patch \
        external/clucene/patches/binary_function.patch \
+       external/clucene/patches/ostream-wchar_t.patch \
 ))
 
 ifneq ($(OS),WNT)
diff --git a/external/clucene/patches/ostream-wchar_t.patch 
b/external/clucene/patches/ostream-wchar_t.patch
new file mode 100644
index 000000000000..63c9e148144e
--- /dev/null
+++ b/external/clucene/patches/ostream-wchar_t.patch
@@ -0,0 +1,29 @@
+--- src/core/CLucene/index/DocumentsWriterThreadState.cpp
++++ src/core/CLucene/index/DocumentsWriterThreadState.cpp
+@@ -484,7 +484,7 @@
+         last->next = fp->next;
+ 
+       if (_parent->infoStream != NULL)
+-        (*_parent->infoStream) << "  remove field=" << fp->fieldInfo->name << 
"
";
++        (*_parent->infoStream) << "  remove field
";
+ 
+       _CLDELETE(fp);
+     } else {
+@@ -557,7 +557,7 @@
+     fieldDataArray[i]->processField(analyzer);
+ 
+   if (maxTermPrefix != NULL && _parent->infoStream != NULL)
+-    (*_parent->infoStream) << "WARNING: document contains at least one 
immense term (longer than the max length " << MAX_TERM_LENGTH << "), all of 
which were skipped.  Please correct the analyzer to not produce such terms.  
The prefix of the first immense term is: '" << maxTermPrefix << "...'
";
++    (*_parent->infoStream) << "WARNING: document contains at least one 
immense term (longer than the max length " << MAX_TERM_LENGTH << "), all of 
which were skipped.  Please correct the analyzer to not produce such terms.
";
+ 
+   if (_parent->ramBufferSize != IndexWriter::DISABLE_AUTO_FLUSH
+       && _parent->numBytesUsed > 0.95 * _parent->ramBufferSize)
+@@ -910,7 +910,7 @@
+                                       // truncate the token stream after 
maxFieldLength tokens.
+                                       if ( length >= maxFieldLength) {
+                 if (_parent->infoStream != NULL)
+-                  (*_parent->infoStream) << "maxFieldLength "  << 
maxFieldLength << " reached for field " << fieldInfo->name << ", ignoring 
following tokens
";
++                  (*_parent->infoStream) << "maxFieldLength "  << 
maxFieldLength << " reached for field, ignoring following tokens
";
+                                               break;
+                                       }
+                               } else if (length > 
IndexWriter::DEFAULT_MAX_FIELD_LENGTH) {

Reply via email to