summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Dapena Paz <jose.dapena@lge.com>2018-06-01 18:30:33 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-01 18:30:33 +0000
commit075e0395b4864e54d4eaaddb789a6b210b433293 (patch)
tree0adb60dec829dbca7dd18e1c661c01a985e67547
parentabdf7e101fbfbe4a19aa7e5d6519891126c7cb21 (diff)
downloadpdfium-075e0395b4864e54d4eaaddb789a6b210b433293.tar.xz
GCC6: workaround bug with external class template linking.
In the case of ByteStringView and WideStringView, non official build fails to link in GCC 6.3 or older. But it works in GCC 7.2. A workaround for this problem is avoiding declaring in same file extern and explicit class template for them. It seems to be related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57728 though that bug is supposed to be already fixed in 6.3.0. Change-Id: Ia6323f23138c0c11e59ce7aa31da1f6c11bc4a5a Reviewed-on: https://pdfium-review.googlesource.com/33270 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r--core/fxcrt/string_view_template.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/fxcrt/string_view_template.h b/core/fxcrt/string_view_template.h
index 1780e47b03..d774e3f4bd 100644
--- a/core/fxcrt/string_view_template.h
+++ b/core/fxcrt/string_view_template.h
@@ -234,8 +234,12 @@ inline bool operator<(const T* lhs, const StringViewTemplate<T>& rhs) {
return rhs > lhs;
}
+// Workaround for one of the cases external template classes are
+// failing in GCC before version 7 with -O0
+#if !defined(__GNUC__) || __GNUC__ >= 7
extern template class StringViewTemplate<char>;
extern template class StringViewTemplate<wchar_t>;
+#endif
using ByteStringView = StringViewTemplate<char>;
using WideStringView = StringViewTemplate<wchar_t>;