summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-11-24 11:39:20 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-11-24 23:14:01 +0100
commitb789f54cb0bb2ae2f1d2cba3b3e5920085c8696d (patch)
treebec5620cff81d5192ecf29a1bf2c665e571803bb
parent9a7945f36ce95a48e0d525bc444e722b9ec5c452 (diff)
external/poppler: Fix use of std::char_trait<unsigned short>
...now that it is gone from libc++ 16 trunk since <https://github.com/llvm/llvm-project/commit/aeecef08c385b1e4955155dd649a2d3724463849> "[libc++] Remove default definition of std::char_traits", causing > In file included from sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx:20: > In file included from sdext/source/pdfimport/xpdfwrapper/pnghelper.hxx:24: > In file included from sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx:36: > In file included from workdir/UnpackedTarball/poppler/poppler/GfxState.h:41: > In file included from workdir/UnpackedTarball/poppler/poppler/Object.h:43: > In file included from workdir/UnpackedTarball/poppler/goo/GooString.h:46: > ~/llvm/inst/bin/../include/c++/v1/string:676:46: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>' > static_assert(( is_same<_CharT, typename traits_type::char_type>::value), > ^ > workdir/UnpackedTarball/poppler/cpp/poppler-global.h:101:43: note: in instantiation of template class 'std::basic_string<unsigned short>' requested here > class POPPLER_CPP_EXPORT ustring : public std::basic_string<unsigned short> > ^ > ~/llvm/inst/bin/../include/c++/v1/__fwd/string.h:22:29: note: template is declared here > struct _LIBCPP_TEMPLATE_VIS char_traits; > ^ > In file included from sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx:20: > In file included from sdext/source/pdfimport/xpdfwrapper/pnghelper.hxx:24: > In file included from sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx:36: > In file included from workdir/UnpackedTarball/poppler/poppler/GfxState.h:41: > In file included from workdir/UnpackedTarball/poppler/poppler/Object.h:43: > In file included from workdir/UnpackedTarball/poppler/goo/GooString.h:46: > In file included from ~/llvm/inst/bin/../include/c++/v1/string:576: > ~/llvm/inst/bin/../include/c++/v1/string_view:279:45: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>' > static_assert((is_same<_CharT, typename traits_type::char_type>::value), > ^ > ~/llvm/inst/bin/../include/c++/v1/__type_traits/is_convertible.h:30:66: note: in instantiation of template class 'std::basic_string_view<unsigned short>' requested here > : public integral_constant<bool, __is_convertible_to(_T1, _T2)> {}; > ^ > ~/llvm/inst/bin/../include/c++/v1/string:650:7: note: in instantiation of template class 'std::is_convertible<const std::basic_string<unsigned short> &, std::basic_string_view<unsigned short>>' requested here > is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value && > ^ > ~/llvm/inst/bin/../include/c++/v1/string:967:35: note: in instantiation of template class 'std::__can_be_converted_to_string_view<unsigned short, std::char_traits<unsigned short>, std::basic_string<unsigned short>>' requested here > class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && > ^ > ~/llvm/inst/bin/../include/c++/v1/string:969:93: note: in instantiation of default argument for 'basic_string<std::basic_string<unsigned short>>' required here > _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string( > ^~~~~~~~~~~~~ > ~/llvm/inst/bin/../include/c++/v1/string:657:7: note: while substituting deduced template arguments into function template 'basic_string' [with _Tp = std::basic_string<unsigned short>, $1 = (no value)] > class basic_string > ^ > workdir/UnpackedTarball/poppler/cpp/poppler-global.h:101:26: note: while declaring the implicit copy constructor for 'ustring' > class POPPLER_CPP_EXPORT ustring : public std::basic_string<unsigned short> > ^ > ~/llvm/inst/bin/../include/c++/v1/__fwd/string.h:22:29: note: template is declared here > struct _LIBCPP_TEMPLATE_VIS char_traits; > ^ Change-Id: Ia1dfda1866ffac22b1c8c99eb11412c095bcc4a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143237 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--external/poppler/UnpackedTarball_poppler.mk1
-rw-r--r--external/poppler/char_traits.patch11
2 files changed, 12 insertions, 0 deletions
diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk
index 5726814fee82..62ed7a24ec1d 100644
--- a/external/poppler/UnpackedTarball_poppler.mk
+++ b/external/poppler/UnpackedTarball_poppler.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\
external/poppler/pch.patch.0 \
external/poppler/disable-freetype.patch.1 \
external/poppler/gcc7-EntityInfo.patch.1 \
+ external/poppler/char_traits.patch \
))
ifneq ($(filter -fsanitize=%,$(CC)),)
diff --git a/external/poppler/char_traits.patch b/external/poppler/char_traits.patch
new file mode 100644
index 000000000000..3483f2fe22d8
--- /dev/null
+++ b/external/poppler/char_traits.patch
@@ -0,0 +1,11 @@
+--- cpp/poppler-global.h
++++ cpp/poppler-global.h
+@@ -98,7 +98,7 @@
+ # pragma warning(push)
+ # pragma warning(disable : 4251) /* class 'A' needs to have dll interface for to be used by clients of class 'B'. */
+ #endif
+-class POPPLER_CPP_EXPORT ustring : public std::basic_string<unsigned short>
++class POPPLER_CPP_EXPORT ustring : public std::u16string
+ {
+ public:
+ ustring();