summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Rasmus Thomsen <cogitri@exherbo.org> 2018-08-01 19:31:05 +0200
committerAvatar Rasmus Thomsen <cogitri@exherbo.org> 2018-08-01 19:40:06 +0200
commit907b76d931c53b16a4108e7bd8f9548496581740 (patch)
tree804ccda5728d07476efaf330f0d7631d5f965736
parent4bcb14a15c5d7f517b374f6103185c0120491bff (diff)
downloadcogitri-907b76d931c53b16a4108e7bd8f9548496581740.tar.gz
cogitri-907b76d931c53b16a4108e7bd8f9548496581740.tar.xz
telegram-desktop: fix build with gcc 7.x
-rw-r--r--packages/net-im/telegram-desktop/files/gcc-if-constexpr-tmpfix.patch42
-rw-r--r--packages/net-im/telegram-desktop/telegram-desktop-1.3.10.exheres-02
2 files changed, 32 insertions, 12 deletions
diff --git a/packages/net-im/telegram-desktop/files/gcc-if-constexpr-tmpfix.patch b/packages/net-im/telegram-desktop/files/gcc-if-constexpr-tmpfix.patch
index 7b421e0..701a6b3 100644
--- a/packages/net-im/telegram-desktop/files/gcc-if-constexpr-tmpfix.patch
+++ b/packages/net-im/telegram-desktop/files/gcc-if-constexpr-tmpfix.patch
@@ -1,11 +1,11 @@
Source: https://github.com/reagentoo/gentoo-overlay/blob/1aa11de043487fa4dc6caa8e9655a90ecba70e6c/net-im/telegram-desktop/files/patches/gcc-if-constexpr-tmpfix.patch
Upstream: No
Reason: Fix compiler SIGSEV of GCC 7.x
-diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp
-index 0cc79f7e2..b54065ba1 100644
---- a/Telegram/SourceFiles/export/data/export_data_types.cpp
-+++ b/Telegram/SourceFiles/export/data/export_data_types.cpp
-@@ -179,7 +179,8 @@ Image ParseMaxImage(
+diff --git SourceFiles/export/data/export_data_types.cpp SourceFiles/export/data/export_data_types.cpp
+index f835dc2f9..188708ab8 100644
+--- Telegram/SourceFiles/export/data/export_data_types.cpp
++++ Telegram/SourceFiles/export/data/export_data_types.cpp
+@@ -221,7 +221,8 @@ Image ParseMaxImage(
result.width = data.vw.v;
result.height = data.vh.v;
result.file.location = ParseLocation(data.vlocation);
@@ -15,11 +15,31 @@ index 0cc79f7e2..b54065ba1 100644
result.file.content = data.vbytes.v;
result.file.size = result.file.content.size();
} else {
-diff --git a/Telegram/SourceFiles/export/export_api_wrap.cpp b/Telegram/SourceFiles/export/export_api_wrap.cpp
-index 34ddd1b5a..21816472a 100644
---- a/Telegram/SourceFiles/export/export_api_wrap.cpp
-+++ b/Telegram/SourceFiles/export/export_api_wrap.cpp
-@@ -710,7 +710,8 @@ void ApiWrap::handleUserpicsSlice(const MTPphotos_Photos &result) {
+@@ -409,7 +410,8 @@ Document ParseDocument(
+ result.width = data.vw.v;
+ result.height = data.vh.v;
+ result.file.location = ParseLocation(data.vlocation);
+- if constexpr (MTPDphotoCachedSize::Is<decltype(data)>()) {
++ constexpr bool is = MTPDphotoCachedSize::Is<decltype(data)>();
++ if constexpr (is) {
+ result.file.content = data.vbytes.v;
+ result.file.size = result.file.content.size();
+ } else {
+@@ -1017,7 +1019,8 @@ Message ParseMessage(
+ auto result = Message();
+ data.match([&](const auto &data) {
+ result.id = data.vid.v;
+- if constexpr (!MTPDmessageEmpty::Is<decltype(data)>()) {
++ constexpr bool is = (!MTPDmessageEmpty::Is<decltype(data)>());
++ if constexpr (is) {
+ result.toId = ParsePeerId(data.vto_id);
+ const auto peerId = (!data.is_out()
+ && data.has_from_id()
+diff --git SourceFiles/export/export_api_wrap.cpp SourceFiles/export/export_api_wrap.cpp
+index b618937f6..528d61393 100644
+--- Telegram/SourceFiles/export/export_api_wrap.cpp
++++ Telegram/SourceFiles/export/export_api_wrap.cpp
+@@ -709,7 +709,8 @@ void ApiWrap::handleUserpicsSlice(const MTPphotos_Photos &result) {
Expects(_userpicsProcess != nullptr);
result.match([&](const auto &data) {
@@ -29,7 +49,7 @@ index 34ddd1b5a..21816472a 100644
_userpicsProcess->lastSlice = true;
}
loadUserpicsFiles(Data::ParseUserpicsSlice(
-@@ -1128,7 +1129,8 @@ void ApiWrap::requestMessagesSlice() {
+@@ -1141,7 +1142,8 @@ void ApiWrap::requestMessagesSlice() {
result.match([&](const MTPDmessages_messagesNotModified &data) {
error("Unexpected messagesNotModified received.");
}, [&](const auto &data) {
diff --git a/packages/net-im/telegram-desktop/telegram-desktop-1.3.10.exheres-0 b/packages/net-im/telegram-desktop/telegram-desktop-1.3.10.exheres-0
index 0a115e1..bdf8b60 100644
--- a/packages/net-im/telegram-desktop/telegram-desktop-1.3.10.exheres-0
+++ b/packages/net-im/telegram-desktop/telegram-desktop-1.3.10.exheres-0
@@ -12,7 +12,7 @@ DEFAULT_SRC_PREPARE_PATCHES=(
"${FILES}"/PrecompiledHeader-cmake.patch
"${FILES}"/fix-static-qt-functions.patch
"${FILES}"/fix-xdg-files.patch
- "${FILES}"/gcc-if-constexpr-tmpfix.patch
+ -p0 "${FILES}"/gcc-if-constexpr-tmpfix.patch
)
# Fail to build