[Libreoffice-commits] core.git: Branch 'feature/cib_contract3753' - 9 commits - external/coinmp external/liborcus external/libwpd include/o3tl odk/build-examples_common.mk solenv/gbuild sw/qa sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 2 12:20:18 UTC 2021


 external/coinmp/UnpackedTarball_coinmp.mk     |    2 
 external/coinmp/configure-exit.patch          |   33 ++
 external/coinmp/register.patch                |  369 ++++++++++++++++++++++++++
 external/liborcus/UnpackedTarball_liborcus.mk |    1 
 external/liborcus/include.patch.0             |   30 ++
 external/libwpd/UnpackedTarball_libwpd.mk     |    1 
 external/libwpd/include.patch                 |   10 
 include/o3tl/lru_map.hxx                      |    2 
 odk/build-examples_common.mk                  |    2 
 solenv/gbuild/platform/com_GCC_defs.mk        |    4 
 sw/qa/extras/unowriter/unowriter.cxx          |    3 
 sw/source/core/unocore/unoobj2.cxx            |   23 +
 12 files changed, 473 insertions(+), 7 deletions(-)

New commits:
commit 70d624adfc9744373aaa5da47dd7d3bb8ff8c85f
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Fri Jul 2 13:16:36 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 2 14:13:48 2021 +0200

    sw: handle RANGE_IS_SECTION in SwXTextRange::getText()
    
    It always returned null.
    
    This was missing in 6471d88cb8b61741c51499ac579dd16cb5b67ebf
    
    Change-Id: Ibf34c24fdbbbc2f65c6948f58d12f257ccf120ae

diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx
index 48c3ed7ba90d..b82001b07a84 100644
--- a/sw/qa/extras/unowriter/unowriter.cxx
+++ b/sw/qa/extras/unowriter/unowriter.cxx
@@ -392,6 +392,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTableAtStart)
         xTTS->getTransferableForTextRange(xAnchor));
 
     // check this doesn't throw
+    CPPUNIT_ASSERT(xAnchor->getText().is());
     CPPUNIT_ASSERT(xAnchor->getStart().is());
     CPPUNIT_ASSERT(xAnchor->getEnd().is());
 
@@ -451,6 +452,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTableAtEnd)
         xTTS->getTransferableForTextRange(xAnchor));
 
     // check this doesn't throw
+    CPPUNIT_ASSERT(xAnchor->getText().is());
     CPPUNIT_ASSERT(xAnchor->getStart().is());
     CPPUNIT_ASSERT(xAnchor->getEnd().is());
 
@@ -512,6 +514,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTable)
         xTTS->getTransferableForTextRange(xAnchor));
 
     // check this doesn't throw
+    CPPUNIT_ASSERT(xAnchor->getText().is());
     CPPUNIT_ASSERT(xAnchor->getStart().is());
     CPPUNIT_ASSERT(xAnchor->getEnd().is());
 
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index e7673186713c..05b0b7e4fc50 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -722,8 +722,13 @@ public:
     {
         if (m_pTableOrSectionFormat)
         {
+            assert(m_eRangePosition == RANGE_IS_TABLE || m_eRangePosition == RANGE_IS_SECTION);
             StartListening(pTableOrSectionFormat->GetNotifier());
         }
+        else
+        {
+            assert(m_eRangePosition != RANGE_IS_TABLE && m_eRangePosition != RANGE_IS_SECTION);
+        }
     }
 
     virtual ~Impl() override
@@ -983,17 +988,23 @@ SwXTextRange::getText()
 {
     SolarMutexGuard aGuard;
 
-    if (!m_pImpl->m_xParentText.is())
+    if (!m_pImpl->m_xParentText.is() && m_pImpl->m_pTableOrSectionFormat)
     {
-        if (m_pImpl->m_eRangePosition == RANGE_IS_TABLE &&
-            m_pImpl->m_pTableOrSectionFormat)
+        std::optional<SwPosition> oPosition;
+        if (m_pImpl->m_eRangePosition == RANGE_IS_TABLE)
         {
             SwTable const*const pTable = SwTable::FindTable( m_pImpl->m_pTableOrSectionFormat );
             SwTableNode const*const pTableNode = pTable->GetTableNode();
-            const SwPosition aPosition( *pTableNode );
-            m_pImpl->m_xParentText =
-                ::sw::CreateParentXText(m_pImpl->m_rDoc, aPosition);
+            oPosition.emplace(*pTableNode);
+        }
+        else
+        {
+            assert(m_pImpl->m_eRangePosition == RANGE_IS_SECTION);
+            auto const pSectFormat(static_cast<SwSectionFormat const*>(m_pImpl->m_pTableOrSectionFormat));
+            oPosition.emplace(pSectFormat->GetContent().GetContentIdx()->GetNode());
         }
+        m_pImpl->m_xParentText =
+            ::sw::CreateParentXText(m_pImpl->m_rDoc, *oPosition);
     }
     OSL_ENSURE(m_pImpl->m_xParentText.is(), "SwXTextRange::getText: no text");
     return m_pImpl->m_xParentText;
commit 3443ccada744dc6b5f9282df7f0b3016d2e92079
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jan 12 15:50:10 2021 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 2 13:34:56 2021 +0200

    Missing include (for std::min)
    
    Change-Id: I44eebee0149d7e890aeff715dd7ae0005c45378d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109179
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit e24cc814b5b6e50967116cb3908e4bf56b7aee4b)

diff --git a/include/o3tl/lru_map.hxx b/include/o3tl/lru_map.hxx
index 33a1487fa239..fac5f6b739ed 100644
--- a/include/o3tl/lru_map.hxx
+++ b/include/o3tl/lru_map.hxx
@@ -11,6 +11,7 @@
 #ifndef INCLUDED_O3TL_LRU_MAP_HXX
 #define INCLUDED_O3TL_LRU_MAP_HXX
 
+#include <algorithm>
 #include <cassert>
 #include <list>
 #include <unordered_map>
commit 13b43e3919ad4ead93e569659b14c586574d5428
Author:     Jeff Law <law at redhat.com>
AuthorDate: Tue Nov 3 08:05:03 2020 -0700
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 2 13:34:52 2021 +0200

    include cstddef for gcc11
    
    Change-Id: I2f845ce9bb660ad6c1eea80ea81dd71add2c0db1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107191
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 8830cf86b146b1252ac37f351a23246088d569b0)

diff --git a/include/o3tl/lru_map.hxx b/include/o3tl/lru_map.hxx
index e822fde0294c..33a1487fa239 100644
--- a/include/o3tl/lru_map.hxx
+++ b/include/o3tl/lru_map.hxx
@@ -14,6 +14,7 @@
 #include <cassert>
 #include <list>
 #include <unordered_map>
+#include <cstddef>
 
 namespace o3tl
 {
commit e263fa9fce48ff6563edcccd001d00b99db6393c
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Mon May 3 12:48:14 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 2 13:34:47 2021 +0200

    odk: build examples with GCC with explicit -std=c++11
    
    GCC 11 defaults to -std=c++17, which doesn't support exception
    specifications any more.
    
    ddcc98fa50dd9d86a60dada4daa00f4d95ffe005 seems a bit large to backport.
    
    Change-Id: I74a182435b268be8fd7a9ff0be9f404122108b51
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115505
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/odk/build-examples_common.mk b/odk/build-examples_common.mk
index 50ea40ec905e..f05220f3f635 100644
--- a/odk/build-examples_common.mk
+++ b/odk/build-examples_common.mk
@@ -48,7 +48,7 @@ endif
 	$(foreach my_dir,$(2), \
 	    && (cd $(INSTDIR)/$(SDKDIRNAME)/examples/$(my_dir) \
 		&& printf 'yes\n' | LC_ALL=C make \
-			CC="$(CXX)" LINK="$(CXX)" LIB="$(CXX)" \
+			CC="$(CXX) $(if $(filter GCC,$(COM)),-std=c++11)" LINK="$(CXX)" LIB="$(CXX)" \
 		    $(if $(MACOSX_SHELL_HACK), SHELL=$(ODK_BUILD_SHELL), )))) \
 	    >$(call gb_CustomTarget_get_workdir,$(1))/log 2>&1 \
 	|| (RET=$$$$? \
commit e96fd348f65f6ac3333ff51ebe3ae52e1c5111fe
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Tue May 4 09:22:03 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 2 13:34:42 2021 +0200

    gbuild: work around GDB 10 bug with DWARF5 in split debug info
    
    GCC 11 defaults to -gdwarf-5 and GDB can only read it if
    -gsplit-dwarf isn't used.
    
    Dwarf Error: wrong unit_type in compilation unit header (is DW_UT_split_compile (0x05), should be DW_UT_type (0x02)) [in module /workdir/CObject/desktop/source/app/main.dwo]
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=27354
    https://bugzilla.redhat.com/show_bug.cgi?id=1956475
    
    Change-Id: Ie2ac7193a29a8f257cf6f1d711f9fa6941df48ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115054
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit dc8c8a4aa20ddd3139a25d5c052cac9bae944cb8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115193
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 626ea4e62a3e5005fe9825923a1c0c5bdb61cc08)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115504
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 9e3b695360cd..c976652d6ecd 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -205,8 +205,12 @@ gb_DEBUGINFO_FLAGS=-g2
 endif
 gb_LINKER_DEBUGINFO_FLAGS=
 
+# GCC 11 defaults to -gdwarf-5, which GDB 10 doesn't support in split debug info
 ifeq ($(HAVE_GCC_SPLIT_DWARF),TRUE)
 gb_DEBUGINFO_FLAGS+=-gsplit-dwarf
+ifeq ($(COM_IS_CLANG),)
+gb_DEBUGINFO_FLAGS+=-gdwarf-4
+endif
 endif
 
 ifeq ($(ENABLE_GDB_INDEX),TRUE)
commit 64c9f0ad72cb8d5f0af657488f5bcce19a99c8da
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Nov 5 08:16:43 2020 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 2 13:34:27 2021 +0200

    external/libwpd: Missing include for size_t
    
    ...as now reported when building with recent trunk GCC/libstdc++ on Linux:
    
    > In file included from WPXContentListener.cpp:26:
    > In file included from ./WPXContentListener.h:29:
    > ./WPXTable.h:56:31: error: unknown type name 'size_t'; did you mean 'std::size_t'?
    >         const WPXTableCell  *getCell(size_t i, size_t j)
    >                                      ^~~~~~
    >                                      std::size_t
    
    Change-Id: Ic20240f01c7b0305cb87ababf53a3aaf66072d61
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105324
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 8d378abf1de0a47517427c086da26588f846592a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115000
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit 524cfb93d4033917ad20c718d538235078d068d5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115503
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/external/libwpd/UnpackedTarball_libwpd.mk b/external/libwpd/UnpackedTarball_libwpd.mk
index 8d0227b9379d..eefa9331c8d6 100644
--- a/external/libwpd/UnpackedTarball_libwpd.mk
+++ b/external/libwpd/UnpackedTarball_libwpd.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libwpd))
 $(eval $(call gb_UnpackedTarball_add_patches,libwpd,\
 	external/libwpd/libwpd-vs2013.patch.1 \
 	$(if $(SYSTEM_REVENGE),,external/libwpd/rpath.patch) \
+	external/libwpd/include.patch \
 ))
 
 ifneq ($(OS),MACOSX)
diff --git a/external/libwpd/include.patch b/external/libwpd/include.patch
new file mode 100644
index 000000000000..57f52b4b0aa5
--- /dev/null
+++ b/external/libwpd/include.patch
@@ -0,0 +1,10 @@
+--- src/lib/WPXTable.h
++++ src/lib/WPXTable.h
+@@ -36,6 +36,7 @@
+ #ifndef _WPXTABLE_H
+ #define _WPXTABLE_H
+ 
++#include <stddef.h>
+ #include <vector>
+ 
+ struct WPXTableCell
commit 7f25dbb39a16b84e1e4a52c9bb066e0082cd002c
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Oct 1 11:50:40 2020 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 2 13:34:21 2021 +0200

    exteranl/coinmp: Fix build with recent GCC 11 trunk
    
    It had started to fail for me now with
    
    >  ~/gcc/trunk/inst/bin/g++ -DHAVE_CONFIG_H -I. -I. -O -MT CoinFinite.lo -MD -MP -MF .deps/CoinFinite.Tpo -c CoinFinite.cpp  -fPIC -DPIC -o .libs/CoinFinite.o
    > CoinFinite.cpp: In function 'bool CoinFinite(double)':
    > CoinFinite.cpp:38:19: error: 'DBL_MAX' was not declared in this scope
    >    38 |     return val != DBL_MAX && val != -DBL_MAX;
    >       |                   ^~~~~~~
    > CoinFinite.cpp:8:1: note: 'DBL_MAX' is defined in header '<cfloat>'; did you forget to '#include <cfloat>'?
    >     7 | #include "CoinUtilsConfig.h"
    >   +++ |+#include <cfloat>
    >     8 |
    
    because of a missing -DCOINUTILS_BUILD.  Which in turn was caused by
    workdir/UnpackedTarball/coinmp/CoinUtils/configure (see
    workdir/UnpackedTarball/coinmp/CoinUtils/config.log), which first tries to
    determine an ac_declaration that would apparently be a suitable declaration of
    `exit` without actually including <stdlib.h> in a C++ file.  It settles on
    
    > configure:3551: ~/gcc/trunk/inst/bin/g++ -c -g -O2  conftest.cc >&5
    > conftest.cc:15:17: warning: 'void std::exit(int)' has not been declared within 'std'
    >    15 | extern "C" void std::exit (int) throw (); using std::exit;
    >       |                 ^~~
    > <built-in>: note: only here as a 'friend'
    > configure:3557: $? = 0
    
    (which generates a warning, but no error with the given g++ invocation).  The
    determined ac_declaration value is then included in confdefs.h, causing the
    later
    
    > configure:4014: ~/gcc/trunk/inst/bin/g++ -o conftest -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long   -DCOINUTILS_BUILD  -Wl,-z,origin -Wl,-rpath,\$$ORIGIN conftest.cc  >&5
    > conftest.cc:15:17: error: 'void std::exit(int)' has not been declared within 'std'
    >    15 | extern "C" void std::exit (int) throw (); using std::exit;
    >       |                 ^~~
    > <built-in>: note: only here as a 'friend'
    > configure:4020: $? = 1
    > configure: failed program was:
    > | /* confdefs.h.  */
    > |
    > | #define PACKAGE_NAME "CoinUtils"
    > | #define PACKAGE_TARNAME "coinutils"
    > | #define PACKAGE_VERSION "2.9.11"
    > | #define PACKAGE_STRING "CoinUtils 2.9.11"
    > | #define PACKAGE_BUGREPORT "http://projects.coin-or.org/CoinUtils"
    > | #define COINUTILS_VERSION "2.9.11"
    > | #define COINUTILS_VERSION_MAJOR 2
    > | #define COINUTILS_VERSION_MINOR 9
    > | #define COINUTILS_VERSION_RELEASE 11
    > | #define COIN_COINUTILS_VERBOSITY 0
    > | #define COIN_COINUTILS_CHECKLEVEL 0
    > | #ifdef __cplusplus
    > | extern "C" void std::exit (int) throw (); using std::exit;
    > | #endif
    > | /* end confdefs.h.  */
    > |
    > | int
    > | main ()
    > | {
    > | int i=0; i++;
    > |   ;
    > |   return 0;
    > | }
    > configure:4045: WARNING: The flags CXXFLAGS="-O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long   -DCOINUTILS_BUILD" do not work.  I will now just try '-O', but you might want to set CXXFLAGS manually.
    
    to fail, because its g++ invocation including -pedantic-errors turns that
    
    > 'void std::exit(int)' has not been declared within 'std'
    
    warning into an error.
    
    There were similar build failures in the Cgl,
    
    >  ~/gcc/trunk/inst/bin/g++ -DHAVE_CONFIG_H -I. -I. -I~/lo/core/workdir/UnpackedTarball/coinmp/CoinUtils/src -DCOIN_HAS_CLP -O -MT ClpCholeskyDense.lo -MD -MP -MF .deps/ClpCholeskyDense.Tpo -c ClpCholeskyDense.cpp  -fPIC -DPIC -o .libs/ClpCholeskyDense.o
    > In file included from ClpCholeskyDense.cpp:11:
    > ClpHelperFunctions.hpp:16:4: error: #error "don't have header file for math"
    >    16 | #  error "don't have header file for math"
    >       |    ^~~~~
    > In file included from ClpCholeskyDense.cpp:11:
    > ClpHelperFunctions.hpp: In function 'double CoinSqrt(double)':
    > ClpHelperFunctions.hpp:81:13: error: 'sqrt' was not declared in this scope
    >    81 |      return sqrt(x);
    >       |             ^~~~
    
    and Clp,
    
    >  ~/gcc/trunk/inst/bin/g++ -DHAVE_CONFIG_H -I. -I. -I.. -I./.. -I./../CglGomory -I~/lo/core/workdir/UnpackedTarball/coinmp/CoinUtils/src -I~/lo/core/workdir/UnpackedTarball/coinmp/Osi/src/Osi -I~/lo/core/workdir/UnpackedTarball/coinmp/CoinUtils/src -I~/lo/core/workdir/UnpackedTarball/coinmp/Clp/src/OsiClp -I~/lo/core/workdir/UnpackedTarball/coinmp/Clp/src -I~/lo/core/workdir/UnpackedTarball/coinmp/CoinUtils/src -I~/lo/core/workdir/UnpackedTarball/coinmp/Osi/src/Osi -O -MT CglLandPValidator.lo -MD -MP -MF .deps/CglLandPValidator.Tpo -c CglLandPValidator.cpp  -fPIC -DPIC -o .libs/CglLandPValidator.o
    > CglLandPValidator.cpp: In member function 'int LAP::Validator::cleanCut(OsiRowCut&, const double*, const OsiSolverInterface&, const CglParam&, const double*, const double*)':
    > CglLandPValidator.cpp:66:22: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    >    66 |         double val = fabs(elems[i]);
    >       |                      ^~~~
    >       |                      labs
    > CglLandPValidator.cpp: In member function 'int LAP::Validator::cleanCut2(OsiRowCut&, const double*, const OsiSolverInterface&, const CglParam&, const double*, const double*)':
    > CglLandPValidator.cpp:189:23: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    >   189 |     double smallest = fabs(rhs);
    >       |                       ^~~~
    >       |                       labs
    
    subdirectories, and which happened to get solved by the same approach of
    removing problematic ac_declaration values from configure.
    
    I am not sure what all that magic of determining that ac_declaration value is
    supposed to be good for.  There appears to be no trace of it in the
    corresponding configure.ac sources, so it likely was automatically added by some
    dated autotools (all three configure files mention "Generated by GNU
    Autoconf 2.59").  At least on a cursory look, the determined ac_declaration
    appears to only be used in configure itself, and not leak into the actual coinmp
    build stage, so dropping the problematic ac_declaration values is hopefully
    harmless.  These three subdirectories were all that failed for me, but there
    might still be silent issues in other subdirectories when a problematic
    ac_declaration value would negatively affect other configure checks.  (An
    alternative approach could be to regenerate all the configure files from their
    configure.ac sources with a recent autotools.  But at least some of the existing
    external/coinmp/*.patch* already change such configure files, which would need
    to be adapted.)
    
    Change-Id: I0a33b0f654800e8288d3ca28e26a64efc23a3f6b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103756
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 762aacc4e055fffbc605be81f66f2274dccb4be8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114999
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit 802b76340082e817efe67a5be4a021cb998a28a2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115502
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/external/coinmp/UnpackedTarball_coinmp.mk b/external/coinmp/UnpackedTarball_coinmp.mk
index c1f3df9866b1..a918effb1203 100644
--- a/external/coinmp/UnpackedTarball_coinmp.mk
+++ b/external/coinmp/UnpackedTarball_coinmp.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
 	external/coinmp/rpath.patch \
 	external/coinmp/libtool.patch \
 	external/coinmp/register.patch \
+	external/coinmp/configure-exit.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/coinmp/configure-exit.patch b/external/coinmp/configure-exit.patch
new file mode 100644
index 000000000000..0a81b8073fd2
--- /dev/null
+++ b/external/coinmp/configure-exit.patch
@@ -0,0 +1,33 @@
+--- Cgl/configure
++++ Cgl/configure
+@@ -3501,8 +3501,6 @@
+ fi
+ for ac_declaration in \
+    '' \
+-   'extern "C" void std::exit (int) throw (); using std::exit;' \
+-   'extern "C" void std::exit (int); using std::exit;' \
+    'extern "C" void exit (int) throw ();' \
+    'extern "C" void exit (int);' \
+    'void exit (int);'
+--- Clp/configure
++++ Clp/configure
+@@ -3528,8 +3528,6 @@
+ fi
+ for ac_declaration in \
+    '' \
+-   'extern "C" void std::exit (int) throw (); using std::exit;' \
+-   'extern "C" void std::exit (int); using std::exit;' \
+    'extern "C" void exit (int) throw ();' \
+    'extern "C" void exit (int);' \
+    'void exit (int);'
+--- CoinUtils/configure
++++ CoinUtils/configure
+@@ -3527,8 +3527,6 @@
+ fi
+ for ac_declaration in \
+    '' \
+-   'extern "C" void std::exit (int) throw (); using std::exit;' \
+-   'extern "C" void std::exit (int); using std::exit;' \
+    'extern "C" void exit (int) throw ();' \
+    'extern "C" void exit (int);' \
+    'void exit (int);'
commit 8c2d97ab97d5a991a8a432705b8706b8836a48d4
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Jul 20 16:23:18 2020 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 2 13:34:13 2021 +0200

    external/coinmp: C++17 no longer supports "register"
    
    ...and GCC 11 trunk g++ now defaults to C++17, so compilation started to fail
    with that compiler
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99082
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit ad607d898f9826c6fa144783c93541a10ad4740c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114998
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit 656085bf2757437a088058871573385ff45f8ef5)
    
    Change-Id: I792e4c7ff59ad88e5571163d5b2362fdb349667d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115501
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/external/coinmp/UnpackedTarball_coinmp.mk b/external/coinmp/UnpackedTarball_coinmp.mk
index 35cfbfcdbae8..c1f3df9866b1 100644
--- a/external/coinmp/UnpackedTarball_coinmp.mk
+++ b/external/coinmp/UnpackedTarball_coinmp.mk
@@ -40,6 +40,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
 	external/coinmp/ubsan.patch.0 \
 	external/coinmp/rpath.patch \
 	external/coinmp/libtool.patch \
+	external/coinmp/register.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/coinmp/register.patch b/external/coinmp/register.patch
new file mode 100644
index 000000000000..cf4ca4d06c01
--- /dev/null
+++ b/external/coinmp/register.patch
@@ -0,0 +1,369 @@
+--- CoinUtils/src/CoinHelperFunctions.hpp
++++ CoinUtils/src/CoinHelperFunctions.hpp
+@@ -41,7 +41,7 @@
+     handled correctly. */
+ 
+ template <class T> inline void
+-CoinCopyN(register const T* from, const int size, register T* to)
++CoinCopyN(const T* from, const int size, T* to)
+ {
+     if (size == 0 || from == to)
+ 	return;
+@@ -52,10 +52,10 @@
+ 			"CoinCopyN", "");
+ #endif
+ 
+-    register int n = (size + 7) / 8;
++    int n = (size + 7) / 8;
+     if (to > from) {
+-	register const T* downfrom = from + size;
+-	register T* downto = to + size;
++	const T* downfrom = from + size;
++	T* downto = to + size;
+ 	// Use Duff's device to copy
+ 	switch (size % 8) {
+ 	case 0: do{     *--downto = *--downfrom;
+@@ -99,7 +99,7 @@
+     the difference down to int.  -- lh, 100823 --
+ */
+ template <class T> inline void
+-CoinCopy(register const T* first, register const T* last, register T* to)
++CoinCopy(const T* first, const T* last, T* to)
+ {
+     CoinCopyN(first, static_cast<int>(last-first), to);
+ }
+@@ -114,7 +114,7 @@
+     Note JJF - the speed claim seems to be false on IA32 so I have added 
+     CoinMemcpyN which can be used for atomic data */
+ template <class T> inline void
+-CoinDisjointCopyN(register const T* from, const int size, register T* to)
++CoinDisjointCopyN(const T* from, const int size, T* to)
+ {
+ #ifndef _MSC_VER
+     if (size == 0 || from == to)
+@@ -135,7 +135,7 @@
+ 	throw CoinError("overlapping arrays", "CoinDisjointCopyN", "");
+ #endif
+ 
+-    for (register int n = size / 8; n > 0; --n, from += 8, to += 8) {
++    for (int n = size / 8; n > 0; --n, from += 8, to += 8) {
+ 	to[0] = from[0];
+ 	to[1] = from[1];
+ 	to[2] = from[2];
+@@ -167,8 +167,8 @@
+     are copied at a time. The source array is given by its first and "after
+     last" entry; the target array is given by its first entry. */
+ template <class T> inline void
+-CoinDisjointCopy(register const T* first, register const T* last,
+-		 register T* to)
++CoinDisjointCopy(const T* first, const T* last,
++		 T* to)
+ {
+     CoinDisjointCopyN(first, static_cast<int>(last - first), to);
+ }
+@@ -256,7 +256,7 @@
+     alternative coding if USE_MEMCPY defined*/
+ #ifndef COIN_USE_RESTRICT
+ template <class T> inline void
+-CoinMemcpyN(register const T* from, const int size, register T* to)
++CoinMemcpyN(const T* from, const int size, T* to)
+ {
+ #ifndef _MSC_VER
+ #ifdef USE_MEMCPY
+@@ -296,7 +296,7 @@
+ 	throw CoinError("overlapping arrays", "CoinMemcpyN", "");
+ #endif
+ 
+-    for (register int n = size / 8; n > 0; --n, from += 8, to += 8) {
++    for (int n = size / 8; n > 0; --n, from += 8, to += 8) {
+ 	to[0] = from[0];
+ 	to[1] = from[1];
+ 	to[2] = from[2];
+@@ -343,8 +343,8 @@
+     are copied at a time. The source array is given by its first and "after
+     last" entry; the target array is given by its first entry. */
+ template <class T> inline void
+-CoinMemcpy(register const T* first, register const T* last,
+-	   register T* to)
++CoinMemcpy(const T* first, const T* last,
++	   T* to)
+ {
+     CoinMemcpyN(first, static_cast<int>(last - first), to);
+ }
+@@ -358,7 +358,7 @@
+     Note JJF - the speed claim seems to be false on IA32 so I have added 
+     CoinZero to allow for memset. */
+ template <class T> inline void
+-CoinFillN(register T* to, const int size, register const T value)
++CoinFillN(T* to, const int size, const T value)
+ {
+     if (size == 0)
+ 	return;
+@@ -369,7 +369,7 @@
+ 			"CoinFillN", "");
+ #endif
+ #if 1
+-    for (register int n = size / 8; n > 0; --n, to += 8) {
++    for (int n = size / 8; n > 0; --n, to += 8) {
+ 	to[0] = value;
+ 	to[1] = value;
+ 	to[2] = value;
+@@ -413,7 +413,7 @@
+     entries are filled at a time. The array is given by its first and "after
+     last" entry. */
+ template <class T> inline void
+-CoinFill(register T* first, register T* last, const T value)
++CoinFill(T* first, T* last, const T value)
+ {
+     CoinFillN(first, last - first, value);
+ }
+@@ -427,7 +427,7 @@
+     Note JJF - the speed claim seems to be false on IA32 so I have allowed 
+     for memset as an alternative */
+ template <class T> inline void
+-CoinZeroN(register T* to, const int size)
++CoinZeroN(T* to, const int size)
+ {
+ #ifdef USE_MEMCPY
+     // Use memset - seems faster on Intel with gcc
+@@ -448,7 +448,7 @@
+ 			"CoinZeroN", "");
+ #endif
+ #if 1
+-    for (register int n = size / 8; n > 0; --n, to += 8) {
++    for (int n = size / 8; n > 0; --n, to += 8) {
+ 	to[0] = 0;
+ 	to[1] = 0;
+ 	to[2] = 0;
+@@ -519,7 +519,7 @@
+     entries are filled at a time. The array is given by its first and "after
+     last" entry. */
+ template <class T> inline void
+-CoinZero(register T* first, register T* last)
++CoinZero(T* first, T* last)
+ {
+     CoinZeroN(first, last - first);
+ }
+@@ -545,7 +545,7 @@
+     This function was introduced because for some reason compiler tend to
+     handle the <code>max()</code> function differently. */
+ template <class T> inline T
+-CoinMax(register const T x1, register const T x2)
++CoinMax(const T x1, const T x2)
+ {
+     return (x1 > x2) ? x1 : x2;
+ }
+@@ -556,7 +556,7 @@
+     This function was introduced because for some reason compiler tend to
+     handle the min() function differently. */
+ template <class T> inline T
+-CoinMin(register const T x1, register const T x2)
++CoinMin(const T x1, const T x2)
+ {
+     return (x1 < x2) ? x1 : x2;
+ }
+@@ -578,7 +578,7 @@
+     according to operator<. The array is given by a pointer to its first entry
+     and by its size. */
+ template <class T> inline bool
+-CoinIsSorted(register const T* first, const int size)
++CoinIsSorted(const T* first, const int size)
+ {
+     if (size == 0)
+ 	return true;
+@@ -590,7 +590,7 @@
+ #if 1
+     // size1 is the number of comparisons to be made
+     const int size1 = size  - 1;
+-    for (register int n = size1 / 8; n > 0; --n, first += 8) {
++    for (int n = size1 / 8; n > 0; --n, first += 8) {
+ 	if (first[8] < first[7]) return false;
+ 	if (first[7] < first[6]) return false;
+ 	if (first[6] < first[5]) return false;
+@@ -627,7 +627,7 @@
+     according to operator<. The array is given by its first and "after
+     last" entry. */
+ template <class T> inline bool
+-CoinIsSorted(register const T* first, register const T* last)
++CoinIsSorted(const T* first, const T* last)
+ {
+     return CoinIsSorted(first, static_cast<int>(last - first));
+ }
+@@ -638,7 +638,7 @@
+     etc. For speed 8 entries are filled at a time. The array is given by a
+     pointer to its first entry and its size. */
+ template <class T> inline void
+-CoinIotaN(register T* first, const int size, register T init)
++CoinIotaN(T* first, const int size, T init)
+ {
+     if (size == 0)
+ 	return;
+@@ -648,7 +648,7 @@
+ 	throw CoinError("negative number of entries", "CoinIotaN", "");
+ #endif
+ #if 1
+-    for (register int n = size / 8; n > 0; --n, first += 8, init += 8) {
++    for (int n = size / 8; n > 0; --n, first += 8, init += 8) {
+ 	first[0] = init;
+ 	first[1] = init + 1;
+ 	first[2] = init + 2;
+@@ -706,7 +706,7 @@
+     integer array specified by the last two arguments (again, first and "after
+     last" entry). */
+ template <class T> inline T *
+-CoinDeleteEntriesFromArray(register T * arrayFirst, register T * arrayLast,
++CoinDeleteEntriesFromArray(T * arrayFirst, T * arrayLast,
+ 			   const int * firstDelPos, const int * lastDelPos)
+ {
+     int delNum = static_cast<int>(lastDelPos - firstDelPos);
+--- CoinUtils/src/CoinModelUseful2.cpp
++++ CoinUtils/src/CoinModelUseful2.cpp
+@@ -917,8 +917,8 @@
+   
+   int position=0;
+   int nEof=0; // Number of time send of string
+-  register int yystate;
+-  register int yyn;
++  int yystate;
++  int yyn;
+   int yyresult;
+   /* Number of tokens to shift before error messages enabled.  */
+   int yyerrstatus;
+@@ -936,12 +936,12 @@
+   /* The state stack.  */
+   short	yyssa[YYINITDEPTH];
+   short *yyss = yyssa;
+-  register short *yyssp;
++  short *yyssp;
+ 
+   /* The semantic value stack.  */
+   YYSTYPE yyvsa[YYINITDEPTH];
+   YYSTYPE *yyvs = yyvsa;
+-  register YYSTYPE *yyvsp;
++  YYSTYPE *yyvsp;
+ 
+ 
+ 
+--- CoinUtils/src/CoinOslC.h
++++ CoinUtils/src/CoinOslC.h
+@@ -34,30 +34,30 @@
+ extern "C"{
+ #endif
+ 
+-int c_ekkbtrn( register const EKKfactinfo *fact,
++int c_ekkbtrn( const EKKfactinfo *fact,
+ 	    double *dwork1,
+ 	    int * mpt,int first_nonzero);
+-int c_ekkbtrn_ipivrw( register const EKKfactinfo *fact,
++int c_ekkbtrn_ipivrw( const EKKfactinfo *fact,
+ 		   double *dwork1,
+ 		   int * mpt, int ipivrw,int * spare);
+ 
+-int c_ekketsj( register /*const*/ EKKfactinfo *fact,
++int c_ekketsj( /*const*/ EKKfactinfo *fact,
+ 	    double *dwork1,
+ 	    int *mpt2, double dalpha, int orig_nincol,
+ 	    int npivot, int *nuspikp,
+ 	    const int ipivrw, int * spare);
+-int c_ekkftrn( register const EKKfactinfo *fact, 
++int c_ekkftrn( const EKKfactinfo *fact, 
+ 	    double *dwork1,
+ 	    double * dpermu,int * mpt, int numberNonZero);
+ 
+-int c_ekkftrn_ft( register EKKfactinfo *fact, 
++int c_ekkftrn_ft( EKKfactinfo *fact, 
+ 	       double *dwork1, int *mpt, int *nincolp);
+-void c_ekkftrn2( register EKKfactinfo *fact, double *dwork1,
++void c_ekkftrn2( EKKfactinfo *fact, double *dwork1,
+ 	      double * dpermu1,int * mpt1, int *nincolp,
+ 	     double *dwork1_ft, int *mpt_ft, int *nincolp_ft);
+ 
+-int c_ekklfct( register EKKfactinfo *fact);
+-int c_ekkslcf( register const EKKfactinfo *fact);
++int c_ekklfct( EKKfactinfo *fact);
++int c_ekkslcf( const EKKfactinfo *fact);
+ inline void c_ekkscpy(int n, const int *marr1,int *marr2)
+ { CoinMemcpyN(marr1,n,marr2);} 
+ inline void c_ekkdcpy(int n, const double *marr1,double *marr2)
+--- CoinUtils/src/CoinOslFactorization2.cpp
++++ CoinUtils/src/CoinOslFactorization2.cpp
+@@ -20,9 +20,9 @@
+ extern int ets_count;
+ extern int ets_check;
+ #endif
+-#define COIN_REGISTER register
++#define COIN_REGISTER
+ #define COIN_REGISTER2
+-#define COIN_REGISTER3 register
++#define COIN_REGISTER3
+ #ifdef COIN_USE_RESTRICT
+ # define COIN_RESTRICT2 __restrict
+ #else
+--- CoinUtils/src/CoinOslFactorization3.cpp
++++ CoinUtils/src/CoinOslFactorization3.cpp
+@@ -1378,7 +1378,7 @@
+     }
+   }
+ } /* c_ekkmltf */
+-int c_ekklfct( register EKKfactinfo *fact)
++int c_ekklfct( EKKfactinfo *fact)
+ {
+   const int nrow	= fact->nrow;
+   int ninbas = fact->xcsadr[nrow+1]-1;
+@@ -2607,7 +2607,7 @@
+     }
+   }
+ } /* c_ekkclcp */
+-int c_ekkslcf( register const EKKfactinfo *fact)
++int c_ekkslcf( const EKKfactinfo *fact)
+ {
+   int * hrow = fact->xeradr;
+   int * hcol = fact->xecadr;
+--- CoinUtils/src/CoinPackedVectorBase.cpp
++++ CoinUtils/src/CoinPackedVectorBase.cpp
+@@ -194,8 +194,8 @@
+ double
+ CoinPackedVectorBase::oneNorm() const
+ {
+-   register double norm = 0.0;
+-   register const double* elements = getElements();
++   double norm = 0.0;
++   const double* elements = getElements();
+    for (int i = getNumElements() - 1; i >= 0; --i) {
+       norm += fabs(elements[i]);
+    }
+@@ -224,8 +224,8 @@
+ double
+ CoinPackedVectorBase::infNorm() const
+ {
+-   register double norm = 0.0;
+-   register const double* elements = getElements();
++   double norm = 0.0;
++   const double* elements = getElements();
+    for (int i = getNumElements() - 1; i >= 0; --i) {
+       norm = CoinMax(norm, fabs(elements[i]));
+    }
+--- CoinUtils/src/CoinSearchTree.hpp
++++ CoinUtils/src/CoinSearchTree.hpp
+@@ -153,8 +153,8 @@
+   static inline const char* name() { return "CoinSearchTreeComparePreferred"; }
+   inline bool operator()(const CoinTreeSiblings* x,
+ 			 const CoinTreeSiblings* y) const {
+-    register const CoinTreeNode* xNode = x->currentNode();
+-    register const CoinTreeNode* yNode = y->currentNode();
++    const CoinTreeNode* xNode = x->currentNode();
++    const CoinTreeNode* yNode = y->currentNode();
+     const BitVector128 xPref = xNode->getPreferred();
+     const BitVector128 yPref = yNode->getPreferred();
+     bool retval = true;
+--- CoinUtils/src/CoinSimpFactorization.cpp
++++ CoinUtils/src/CoinSimpFactorization.cpp
+@@ -2440,7 +2440,7 @@
+ 	const int row=secRowOfU_[i];
+ 	const int column=colOfU_[i];
+ 	if ( denseVector_[column]==0.0 ) continue;
+-	register const double multiplier=denseVector_[column]*invOfPivots_[row];
++	const double multiplier=denseVector_[column]*invOfPivots_[row];
+ 	denseVector_[column]=0.0;
+ 	const int rowBeg=UrowStarts_[row];
+ 	const int rowEnd=rowBeg+UrowLengths_[row];
commit c62e671184e2b3172008d5695c9fa91f152a5cca
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Oct 7 22:29:46 2020 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 2 13:34:08 2021 +0200

    external/liborcus: Missing includes
    
    ...as seen with recent GCC 11 trunk libstdc++:
    
    > orcus_xlsx.cpp: In function ‘size_t orcus::{anonymous}::get_schema_rank(orcus::schema_t)’:
    > orcus_xlsx.cpp:313:59: error: incomplete type ‘std::numeric_limits<long unsigned int>’ used in nested name specifier
    >   313 |     return it == rank_map.end() ? numeric_limits<size_t>::max() : it->second;
    >       |                                                           ^~~
    
    etc.
    
    Change-Id: If92cfb565ed9344b2ec1403793d7aeff8bd019ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104074
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit a9976a958b2857e308c6598532151878615bfd9f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114997
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit eaa9f84465eb330aa4c68711e8c8ec609503c5d3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115500
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk
index e5e33b0b1249..113e8e25818d 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
 	external/liborcus/gcc9.patch.0 \
 	external/liborcus/libtool.patch.0 \
 	external/liborcus/fix-pch.patch.0 \
+	external/liborcus/include.patch.0 \
 ))
 
 ifeq ($(OS),WNT)
diff --git a/external/liborcus/include.patch.0 b/external/liborcus/include.patch.0
new file mode 100644
index 000000000000..9555dd534b3e
--- /dev/null
+++ b/external/liborcus/include.patch.0
@@ -0,0 +1,30 @@
+--- src/liborcus/orcus_xlsx.cpp
++++ src/liborcus/orcus_xlsx.cpp
+@@ -32,6 +32,7 @@
+ 
+ #include <cstdlib>
+ #include <iostream>
++#include <limits>
+ #include <string>
+ #include <cstring>
+ #include <sstream>
+--- src/liborcus/xls_xml_context.cpp
++++ src/liborcus/xls_xml_context.cpp
+@@ -16,6 +16,7 @@
+ #include <mdds/sorted_string_map.hpp>
+ 
+ #include <iostream>
++#include <limits>
+ 
+ using namespace std;
+ 
+--- src/liborcus/xlsx_revision_context.cpp
++++ src/liborcus/xlsx_revision_context.cpp
+@@ -16,6 +16,7 @@
+ #include "orcus/global.hpp"
+ 
+ #include <iostream>
++#include <limits>
+ 
+ using namespace std;
+ 


More information about the Libreoffice-commits mailing list