[Libreoffice-commits] core.git: 2 commits - config_host/config_global.h.in configure.ac dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk dbaccess/CppunitTest_dbaccess_tdf119625.mk dbaccess/CppunitTest_dbaccess_tdf126268.mk filter/CppunitTest_filter_textfilterdetect.mk include/o3tl o3tl/qa sc/CppunitTest_sc_check_data_pilot_field.mk sc/CppunitTest_sc_check_data_pilot_table.mk sc/CppunitTest_sc_check_xcell_ranges_query.mk sfx2/source svl/CppunitTest_svl_lockfiles.mk vcl/CppunitTest_vcl_png_test.mk writerperfect/CppunitTest_writerperfect_calc.mk writerperfect/CppunitTest_writerperfect_draw.mk writerperfect/CppunitTest_writerperfect_import.mk writerperfect/CppunitTest_writerperfect_impress.mk writerperfect/CppunitTest_writerperfect_writer.mk writerperfect/Library_wpftqahelper.mk
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Sat Dec 7 08:02:37 UTC 2019
config_host/config_global.h.in | 3 +++
configure.ac | 16 ++++++++++++++++
dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk | 2 ++
dbaccess/CppunitTest_dbaccess_tdf119625.mk | 2 ++
dbaccess/CppunitTest_dbaccess_tdf126268.mk | 2 ++
filter/CppunitTest_filter_textfilterdetect.mk | 2 ++
include/o3tl/span.hxx | 14 ++++++++------
o3tl/qa/test-span.cxx | 7 ++++---
sc/CppunitTest_sc_check_data_pilot_field.mk | 2 ++
sc/CppunitTest_sc_check_data_pilot_table.mk | 2 ++
sc/CppunitTest_sc_check_xcell_ranges_query.mk | 2 ++
sfx2/source/control/dispatch.cxx | 3 ++-
svl/CppunitTest_svl_lockfiles.mk | 2 ++
vcl/CppunitTest_vcl_png_test.mk | 2 ++
writerperfect/CppunitTest_writerperfect_calc.mk | 2 ++
writerperfect/CppunitTest_writerperfect_draw.mk | 2 ++
writerperfect/CppunitTest_writerperfect_import.mk | 2 ++
writerperfect/CppunitTest_writerperfect_impress.mk | 2 ++
writerperfect/CppunitTest_writerperfect_writer.mk | 2 ++
writerperfect/Library_wpftqahelper.mk | 1 +
20 files changed, 62 insertions(+), 10 deletions(-)
New commits:
commit 83375454ca1151fabf797f0c47cc8d10156ebc98
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Dec 6 23:23:12 2019 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Dec 7 09:00:26 2019 +0100
Fix more new dependencies on boost_headers
Same as 97b3e455802cfc08568ec5e8379c509efe3e47b1 "Fix some new dependencies on
boost_headers"
Change-Id: I0f10374650847f4c50a8cff530c15e65906865ad
Reviewed-on: https://gerrit.libreoffice.org/84672
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk b/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk
index d203bf3c1be1..6f682c040cf2 100644
--- a/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk
+++ b/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk
@@ -13,6 +13,8 @@ $(eval $(call gb_CppunitTest_add_exception_objects,dbaccess_hsql_binary_import,
dbaccess/qa/unit/hsql_binary_import \
))
+$(eval $(call gb_CppunitTest_use_external,dbaccess_hsql_binary_import,boost_headers))
+
$(eval $(call gb_CppunitTest_use_libraries,dbaccess_hsql_binary_import, \
basegfx \
comphelper \
diff --git a/dbaccess/CppunitTest_dbaccess_tdf119625.mk b/dbaccess/CppunitTest_dbaccess_tdf119625.mk
index 448d671d4911..3420f752dee0 100644
--- a/dbaccess/CppunitTest_dbaccess_tdf119625.mk
+++ b/dbaccess/CppunitTest_dbaccess_tdf119625.mk
@@ -13,6 +13,8 @@ $(eval $(call gb_CppunitTest_add_exception_objects,dbaccess_tdf119625, \
dbaccess/qa/unit/tdf119625 \
))
+$(eval $(call gb_CppunitTest_use_external,dbaccess_tdf119625,boost_headers))
+
$(eval $(call gb_CppunitTest_use_libraries,dbaccess_tdf119625, \
basegfx \
comphelper \
diff --git a/dbaccess/CppunitTest_dbaccess_tdf126268.mk b/dbaccess/CppunitTest_dbaccess_tdf126268.mk
index 379e2f27433b..5d2120ffd54e 100644
--- a/dbaccess/CppunitTest_dbaccess_tdf126268.mk
+++ b/dbaccess/CppunitTest_dbaccess_tdf126268.mk
@@ -13,6 +13,8 @@ $(eval $(call gb_CppunitTest_add_exception_objects,dbaccess_tdf126268, \
dbaccess/qa/unit/tdf126268 \
))
+$(eval $(call gb_CppunitTest_use_external,dbaccess_tdf126268,boost_headers))
+
$(eval $(call gb_CppunitTest_use_libraries,dbaccess_tdf126268, \
basegfx \
comphelper \
diff --git a/filter/CppunitTest_filter_textfilterdetect.mk b/filter/CppunitTest_filter_textfilterdetect.mk
index dfcaee9ce16a..a5a6263abdb8 100644
--- a/filter/CppunitTest_filter_textfilterdetect.mk
+++ b/filter/CppunitTest_filter_textfilterdetect.mk
@@ -14,6 +14,8 @@ $(eval $(call gb_CppunitTest_use_api,filter_textfilterdetect,\
udkapi \
))
+$(eval $(call gb_CppunitTest_use_external,filter_textfilterdetect,boost_headers))
+
$(eval $(call gb_CppunitTest_use_libraries,filter_textfilterdetect, \
comphelper \
cppu \
diff --git a/sc/CppunitTest_sc_check_data_pilot_field.mk b/sc/CppunitTest_sc_check_data_pilot_field.mk
index eb29eae0c8ed..22c682859c7e 100644
--- a/sc/CppunitTest_sc_check_data_pilot_field.mk
+++ b/sc/CppunitTest_sc_check_data_pilot_field.mk
@@ -13,6 +13,8 @@ $(eval $(call gb_CppunitTest_CppunitTest,sc_check_data_pilot_field))
$(eval $(call gb_CppunitTest_use_common_precompiled_header,sc_check_data_pilot_field))
+$(eval $(call gb_CppunitTest_use_external,sc_check_data_pilot_field,boost_headers))
+
$(eval $(call gb_CppunitTest_add_exception_objects,sc_check_data_pilot_field, \
sc/qa/extras/check_data_pilot_field \
))
diff --git a/sc/CppunitTest_sc_check_data_pilot_table.mk b/sc/CppunitTest_sc_check_data_pilot_table.mk
index 1b04eefd7569..e8286a7b4220 100644
--- a/sc/CppunitTest_sc_check_data_pilot_table.mk
+++ b/sc/CppunitTest_sc_check_data_pilot_table.mk
@@ -13,6 +13,8 @@ $(eval $(call gb_CppunitTest_CppunitTest,sc_check_data_pilot_table))
$(eval $(call gb_CppunitTest_use_common_precompiled_header,sc_check_data_pilot_table))
+$(eval $(call gb_CppunitTest_use_external,sc_check_data_pilot_table,boost_headers))
+
$(eval $(call gb_CppunitTest_add_exception_objects,sc_check_data_pilot_table, \
sc/qa/extras/check_data_pilot_table \
))
diff --git a/sc/CppunitTest_sc_check_xcell_ranges_query.mk b/sc/CppunitTest_sc_check_xcell_ranges_query.mk
index b7322fea20cb..c6cc3378739c 100644
--- a/sc/CppunitTest_sc_check_xcell_ranges_query.mk
+++ b/sc/CppunitTest_sc_check_xcell_ranges_query.mk
@@ -13,6 +13,8 @@ $(eval $(call gb_CppunitTest_CppunitTest,sc_check_xcell_ranges_query))
$(eval $(call gb_CppunitTest_use_common_precompiled_header,sc_check_xcell_ranges_query))
+$(eval $(call gb_CppunitTest_use_external,sc_check_xcell_ranges_query,boost_headers))
+
$(eval $(call gb_CppunitTest_add_exception_objects,sc_check_xcell_ranges_query, \
sc/qa/extras/check_xcell_ranges_query \
))
diff --git a/svl/CppunitTest_svl_lockfiles.mk b/svl/CppunitTest_svl_lockfiles.mk
index c93e78b45b8d..fac68330c7a2 100644
--- a/svl/CppunitTest_svl_lockfiles.mk
+++ b/svl/CppunitTest_svl_lockfiles.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_CppunitTest_CppunitTest,svl_lockfiles))
+$(eval $(call gb_CppunitTest_use_external,svl_lockfiles,boost_headers))
+
$(eval $(call gb_CppunitTest_use_sdk_api,svl_lockfiles))
$(eval $(call gb_CppunitTest_use_api,svl_lockfiles,\
diff --git a/vcl/CppunitTest_vcl_png_test.mk b/vcl/CppunitTest_vcl_png_test.mk
index 1f88209313a0..fc513eaecf17 100644
--- a/vcl/CppunitTest_vcl_png_test.mk
+++ b/vcl/CppunitTest_vcl_png_test.mk
@@ -18,6 +18,8 @@ $(eval $(call gb_CppunitTest_set_include,vcl_png_test,\
-I$(SRCDIR)/vcl/inc \
))
+$(eval $(call gb_CppunitTest_use_external,vcl_png_test,boost_headers))
+
$(eval $(call gb_CppunitTest_use_libraries,vcl_png_test, \
comphelper \
cppu \
diff --git a/writerperfect/CppunitTest_writerperfect_calc.mk b/writerperfect/CppunitTest_writerperfect_calc.mk
index 317c43ff8296..54647a34a6e0 100644
--- a/writerperfect/CppunitTest_writerperfect_calc.mk
+++ b/writerperfect/CppunitTest_writerperfect_calc.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_CppunitTest_CppunitTest,writerperfect_calc))
+$(eval $(call gb_CppunitTest_use_external,writerperfect_calc,boost_headers))
+
$(eval $(call gb_CppunitTest_use_sdk_api,writerperfect_calc))
$(eval $(call gb_CppunitTest_use_libraries,writerperfect_calc,\
diff --git a/writerperfect/CppunitTest_writerperfect_draw.mk b/writerperfect/CppunitTest_writerperfect_draw.mk
index 8f96421d68ab..cccbafbf1ddc 100644
--- a/writerperfect/CppunitTest_writerperfect_draw.mk
+++ b/writerperfect/CppunitTest_writerperfect_draw.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_CppunitTest_CppunitTest,writerperfect_draw))
+$(eval $(call gb_CppunitTest_use_external,writerperfect_draw,boost_headers))
+
$(eval $(call gb_CppunitTest_use_sdk_api,writerperfect_draw))
$(eval $(call gb_CppunitTest_use_libraries,writerperfect_draw,\
diff --git a/writerperfect/CppunitTest_writerperfect_import.mk b/writerperfect/CppunitTest_writerperfect_import.mk
index 79e38faeeb66..fe47a54c8533 100644
--- a/writerperfect/CppunitTest_writerperfect_import.mk
+++ b/writerperfect/CppunitTest_writerperfect_import.mk
@@ -13,6 +13,8 @@ $(eval $(call gb_CppunitTest_add_defs,writerperfect_import,\
-DTEST_DIR=\"writerperfect/qa/unit/data/import\" \
))
+$(eval $(call gb_CppunitTest_use_external,writerperfect_import,boost_headers))
+
$(eval $(call gb_CppunitTest_use_sdk_api,writerperfect_import))
$(eval $(call gb_CppunitTest_use_libraries,writerperfect_import,\
diff --git a/writerperfect/CppunitTest_writerperfect_impress.mk b/writerperfect/CppunitTest_writerperfect_impress.mk
index b2cf95a5dbb2..c41e6e2f3532 100644
--- a/writerperfect/CppunitTest_writerperfect_impress.mk
+++ b/writerperfect/CppunitTest_writerperfect_impress.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_CppunitTest_CppunitTest,writerperfect_impress))
+$(eval $(call gb_CppunitTest_use_external,writerperfect_impress,boost_headers))
+
$(eval $(call gb_CppunitTest_use_sdk_api,writerperfect_impress))
$(eval $(call gb_CppunitTest_use_libraries,writerperfect_impress,\
diff --git a/writerperfect/CppunitTest_writerperfect_writer.mk b/writerperfect/CppunitTest_writerperfect_writer.mk
index a1229c0bdeff..254d5e559d8f 100644
--- a/writerperfect/CppunitTest_writerperfect_writer.mk
+++ b/writerperfect/CppunitTest_writerperfect_writer.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_CppunitTest_CppunitTest,writerperfect_writer))
+$(eval $(call gb_CppunitTest_use_external,writerperfect_writer,boost_headers))
+
$(eval $(call gb_CppunitTest_use_sdk_api,writerperfect_writer))
$(eval $(call gb_CppunitTest_use_libraries,writerperfect_writer,\
diff --git a/writerperfect/Library_wpftqahelper.mk b/writerperfect/Library_wpftqahelper.mk
index 59f4d05b504d..d6750e050612 100644
--- a/writerperfect/Library_wpftqahelper.mk
+++ b/writerperfect/Library_wpftqahelper.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_Library_add_defs,wpftqahelper,\
))
$(eval $(call gb_Library_use_externals,wpftqahelper,\
+ boost_headers \
cppunit \
))
commit 8e6865188242bccb3d8aa857ddc990d72a058d3d
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Dec 6 16:36:01 2019 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Dec 7 09:00:00 2019 +0100
Adapt o3tl::span to P1872R0
..."span should have size_type, not index_type"
(<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf>), as
implemented by libc++ since <https://github.com/llvm/llvm-project/commit/
1466335cf4b2854a0be1defcf279fe50772bad6f> "[libc++][P1872] span should have
size_type, not index_type."
All uses of index_type had been added to mitigate the previous std::span change
from signed (ptrdiff_t) to unsigned (size_t) index_type, see
6ef8420fdbf8dff16de13147c5ab833bc5e01121 "Adapt o3tl::span to updated C++2a
std::span". There is no easy solution to transparently support all three
std::span variants currently out there (signed index_type, unsigned index_type,
unsigned size_type), without causing compilation failures due to
CPPUNIT_ASSERT_EQUAL with arguments of different types, or compiler warnings
about mixed signed/unsigned comparisons. So rule out the oldest std::span
variant (signed index_type) in configure.ac (so that o3tl::span will use its
own hand-rolled code in that case) and simplify the uses of index_type to
std::size_t (as had already been mentioned in
6ef8420fdbf8dff16de13147c5ab833bc5e01121).
Change-Id: I6ddf424ffb7941da3f69ad66fd29ecd35f09afae
Reviewed-on: https://gerrit.libreoffice.org/84652
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in
index adb36c39ab8b..5b04594c12f5 100644
--- a/config_host/config_global.h.in
+++ b/config_host/config_global.h.in
@@ -29,6 +29,9 @@ Any change in this header will cause a rebuild of almost everything.
// constexpr", and <https://wg21.link/P1143R2> "Adding the constinit keyword":
#define HAVE_CPP_CONSTINIT_SORTED_VECTOR 0
+// Useable C++2a <span>:
+#define HAVE_CPP_SPAN 0
+
/* GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87150> "move ctor wrongly chosen in return
stmt (derived vs. base)": */
#define HAVE_GCC_BUG_87150 0
diff --git a/configure.ac b/configure.ac
index 651e9d60c2d4..194a3cc80fa5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6701,6 +6701,22 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
+AC_MSG_CHECKING([whether $CXX_BASE supports C++2a <span> with unsigned size_type])
+AC_LANG_PUSH([C++])
+save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+ #include <span>
+ #include <type_traits>
+ // Don't check size_type directly, as it was called index_type before P1872R0:
+ void f(std::span<int> s) { static_assert(std::is_unsigned_v<decltype(s.size())>); };
+ ])], [
+ AC_DEFINE([HAVE_CPP_SPAN],[1])
+ AC_MSG_RESULT([yes])
+ ], [AC_MSG_RESULT([no])])
+CXXFLAGS=$save_CXXFLAGS
+AC_LANG_POP([C++])
+
AC_MSG_CHECKING([whether $CXX_BASE has GCC bug 87150])
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
diff --git a/include/o3tl/span.hxx b/include/o3tl/span.hxx
index 1618b86df897..b19d2d847ac7 100644
--- a/include/o3tl/span.hxx
+++ b/include/o3tl/span.hxx
@@ -12,7 +12,9 @@
#include <sal/config.h>
-#if __has_include(<span>)
+#include <config_global.h>
+
+#if HAVE_CPP_SPAN
#include <span>
@@ -40,7 +42,7 @@ public:
using iterator = pointer;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
using reverse_iterator = std::reverse_iterator<iterator>;
- using index_type = std::size_t;
+ using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
constexpr span() noexcept : data_(nullptr), size_(0) {}
@@ -48,7 +50,7 @@ public:
template<std::size_t N>
constexpr span (T (&a)[N]) noexcept : data_(a), size_(N) {}
- constexpr span (T *a, index_type len) noexcept
+ constexpr span (T *a, size_type len) noexcept
: data_(a), size_(len)
{
// not terribly sure about this, might need to strengthen it
@@ -72,9 +74,9 @@ public:
{ return rbegin(); }
constexpr const_reverse_iterator crend() const noexcept { return rend(); }
- constexpr index_type size() const noexcept { return size_; }
+ constexpr size_type size() const noexcept { return size_; }
- constexpr reference operator [](index_type pos) const {
+ constexpr reference operator [](size_type pos) const {
assert(pos < size());
return data_[pos];
}
@@ -83,7 +85,7 @@ public:
private:
pointer data_;
- index_type size_;
+ size_type size_;
};
} // namespace o3tl
diff --git a/o3tl/qa/test-span.cxx b/o3tl/qa/test-span.cxx
index 7ec67fa7fd91..3cb78ace1db2 100644
--- a/o3tl/qa/test-span.cxx
+++ b/o3tl/qa/test-span.cxx
@@ -9,6 +9,7 @@
#include <sal/config.h>
+#include <cstddef>
#include <utility>
#include <cppunit/TestAssert.h>
@@ -42,7 +43,7 @@ private:
CPPUNIT_ASSERT_EQUAL(3, *v.crbegin());
CPPUNIT_ASSERT_EQUAL(
o3tl::span<int>::difference_type(3), v.crend() - v.crbegin());
- CPPUNIT_ASSERT_EQUAL(o3tl::span<int>::index_type(3), v.size());
+ CPPUNIT_ASSERT_EQUAL(std::size_t(3), v.size());
CPPUNIT_ASSERT(!v.empty());
CPPUNIT_ASSERT_EQUAL(2, v[1]);
CPPUNIT_ASSERT_EQUAL(1, *v.data());
@@ -52,8 +53,8 @@ private:
o3tl::span<int const> v1( d1 );
o3tl::span<int const> v2( d2 );
std::swap(v1, v2);
- CPPUNIT_ASSERT_EQUAL(o3tl::span<int>::index_type(4), v1.size());
- CPPUNIT_ASSERT_EQUAL(o3tl::span<int>::index_type(2), v2.size());
+ CPPUNIT_ASSERT_EQUAL(std::size_t(4), v1.size());
+ CPPUNIT_ASSERT_EQUAL(std::size_t(2), v2.size());
}
}
};
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 9edf43c4ecd6..9b6519ca1814 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -20,6 +20,7 @@
#include <config_feature_desktop.h>
#include <algorithm>
+#include <cstddef>
#include <deque>
#include <vector>
@@ -1453,7 +1454,7 @@ void SfxDispatcher::SetSlotFilter(SfxSlotFilterState nEnable,
{
#ifdef DBG_UTIL
// Check Array
- for ( o3tl::span<sal_uInt16 const>::index_type n = 1; n < pSIDs.size(); ++n )
+ for ( std::size_t n = 1; n < pSIDs.size(); ++n )
DBG_ASSERT( pSIDs[n] > pSIDs[n-1], "SetSlotFilter: SIDs not sorted" );
#endif
More information about the Libreoffice-commits
mailing list