Kaydet (Commit) 8fa5c031 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 41506271
......@@ -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
......
......@@ -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.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
......@@ -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
}
}
......
......@@ -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
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment