summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-12-07 11:46:25 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-12-07 18:52:03 +0100
commit8fa5c0315046e741d301ed236c946c55693d1eee (patch)
tree1e069a9479232eced3af784f07bc328a7be80604
parent4150627176623ca9abcf2317bbd178bc23914c7c (diff)
HAVE_BROKEN_CONST_ITERATORS is always false now
...but for safety, leave the configure.ac check in for some longer. Change-Id: Ife94cdfd56696edb113e32d84f563dd805e757e5 Reviewed-on: https://gerrit.libreoffice.org/64769 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--config_host/config_global.h.in1
-rw-r--r--configure.ac16
-rw-r--r--configure.patch32
-rw-r--r--sdext/source/pdfimport/tree/drawtreevisiting.cxx8
-rw-r--r--sdext/source/pdfimport/tree/writertreevisiting.cxx8
5 files changed, 36 insertions, 29 deletions
diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in
index 1c9e610f9167..504594d0081b 100644
--- a/config_host/config_global.h.in
+++ b/config_host/config_global.h.in
@@ -18,7 +18,6 @@ Any change in this header will cause a rebuild of almost everything.
/* _Pragma */
#define HAVE_GCC_PRAGMA_OPERATOR 0
#define HAVE_GCC_DEPRECATED_MESSAGE 0
-#define HAVE_BROKEN_CONST_ITERATORS 0
#define HAVE_SYSLOG_H 0
/* Compiler supports __attribute__((warn_unused)). */
#define HAVE_GCC_ATTRIBUTE_WARN_UNUSED 0
diff --git a/configure.ac b/configure.ac
index 04bac9d771ae..81e7d8aaaeb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12504,13 +12504,9 @@ if test "$build_os" = cygwin; then
fi
AC_LANG_POP([C++])
-dnl We should be able to drop the below check when bumping the GCC baseline to
-dnl 4.9, as <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54577>
-dnl "deque<T>::erase() still takes iterator instead of const_iterator" should be
-dnl fixed there with <https://gcc.gnu.org/git/?p=gcc.git;a=commit;
-dnl h=6b0e18ca48bb4b4c01e7b5be2b98849943fdcf91>:
+dnl This check can eventually be removed completely (e.g., after libreoffice-6-3 branch off):
AC_MSG_CHECKING(
- [whether C++11 use of const_iterator in standard containers is broken])
+ [that C++11 use of const_iterator in standard containers is not broken])
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
AC_LANG_PUSH([C++])
@@ -12520,14 +12516,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
std::list<int> l;
l.erase(l.cbegin());
]])],
- [broken=no], [broken=yes])
+ AC_MSG_RESULT([yes]),
+ AC_MSG_ERROR([C++11 use of const_iterator in standard containers must not broken]))
AC_LANG_POP([C++])
CXXFLAGS=$save_CXXFLAGS
-AC_MSG_RESULT([$broken])
-if test "$broken" = yes; then
- AC_DEFINE([HAVE_BROKEN_CONST_ITERATORS])
-fi
-
# ===================================================================
# Creating bigger shared library to link against
diff --git a/configure.patch b/configure.patch
new file mode 100644
index 000000000000..4aa1650c4b05
--- /dev/null
+++ b/configure.patch
@@ -0,0 +1,32 @@
+diff --git a/configure.ac b/configure.ac
+index d4a6a13..f8c5895 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -12064,13 +12064,14 @@ if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
+ if test "$_os" = "WINNT"; then
+ OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
+ fi
+- "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
+- grep org/junit/Before.class > /dev/null 2>&5
+- if test $? -eq 0; then
++ if "$JAVA_HOME/bin/javah" -o conftestj -classpath "$OOO_JUNIT_JAR" \
++ org.junit.Before > /dev/null 2>&5
++ then
+ # check if either class-path entry is available for hamcrest or
+ # it's bundled
+- if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |$GREP -q hamcrest || \
+- "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |$GREP 'Class-Path:' | $GREP -q 'hamcrest'; then
++ if "$JAVA_HOME/bin/javah" -o conftestj -classpath "$OOO_JUNIT_JAR" \
++ org.hamcrest.BaseDescription > /dev/null 2>&5
++ then
+ AC_MSG_RESULT([$OOO_JUNIT_JAR])
+ else
+ AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
+@@ -12082,6 +12083,7 @@ provide a full junit jar or use --without-junit])
+ location (/usr/share/java), specify its pathname via
+ --with-junit=..., or disable it via --without-junit])
+ fi
++ rm conftestj
+ if test $OOO_JUNIT_JAR != ""; then
+ BUILD_TYPE="$BUILD_TYPE QADEVOOO"
+ fi
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 8182d5fd47eb..b50a80a2ff48 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -28,7 +28,6 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/range/b2drange.hxx>
-#include <config_global.h>
#include <osl/diagnose.h>
#include <com/sun/star/i18n/BreakIterator.hpp>
#include <com/sun/star/i18n/CharacterClassification.hpp>
@@ -449,14 +448,7 @@ void DrawXmlOptimizer::visit( PolyPolyElement& elem, const std::list< std::uniqu
elem.Action |= pNext->Action;
elem.Children.splice( elem.Children.end(), pNext->Children );
- // workaround older compilers that do not have std::list::erase(const_iterator)
-#if HAVE_BROKEN_CONST_ITERATORS
- auto tmpIt = elem.Parent->Children.begin();
- std::advance(tmpIt, std::distance(elem.Parent->Children.cbegin(), next_it));
- elem.Parent->Children.erase(tmpIt);
-#else
elem.Parent->Children.erase(next_it);
-#endif
}
}
diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx
index 6e37899fbd55..a16f4b443068 100644
--- a/sdext/source/pdfimport/tree/writertreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx
@@ -28,7 +28,6 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/range/b2drange.hxx>
-#include <config_global.h>
#include <osl/diagnose.h>
using namespace ::com::sun::star;
@@ -411,14 +410,7 @@ void WriterXmlOptimizer::visit( PolyPolyElement& elem, const std::list< std::uni
elem.Action |= pNext->Action;
elem.Children.splice( elem.Children.end(), pNext->Children );
- // workaround older compilers that do not have std::list::erase(const_iterator)
-#if HAVE_BROKEN_CONST_ITERATORS
- auto tmpIt = elem.Parent->Children.begin();
- std::advance(tmpIt, std::distance(elem.Parent->Children.cbegin(), next_it));
- elem.Parent->Children.erase(tmpIt);
-#else
elem.Parent->Children.erase(next_it);
-#endif
}
}