Version 1.0.26 for macOS: Fix Clang builds.

Custom build of libc++ for OS X 10.6-10.7 already has C++17 as_const.
Add workaround for Apple Clang has strange issues (freeze and segfault).
This commit is contained in:
John Preston 2017-03-30 15:00:02 +03:00
parent e6d94b5ee7
commit a851497bbf
3 changed files with 9 additions and 2 deletions

View File

@ -576,7 +576,8 @@ void EditCaptionBox::prepareGifPreview(DocumentData *document) {
auto createGifPreview = [document] { auto createGifPreview = [document] {
return (document && document->isAnimation()); return (document && document->isAnimation());
}; };
if (createGifPreview()) { auto createGifPreviewResult = createGifPreview(); // Clang freeze workaround.
if (createGifPreviewResult) {
_gifPreview = Media::Clip::MakeReader(document->location(), document->data(), [this](Media::Clip::Notification notification) { _gifPreview = Media::Clip::MakeReader(document->location(), document->data(), [this](Media::Clip::Notification notification) {
clipCallback(notification); clipCallback(notification);
}); });

View File

@ -27,6 +27,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "core/build_config.h" #include "core/build_config.h"
// Custom libc++ build used for old OS X versions already has this.
#ifndef OS_MAC_OLD
#if defined COMPILER_CLANG || defined COMPILER_GCC #if defined COMPILER_CLANG || defined COMPILER_GCC
namespace std { namespace std {
@ -41,6 +44,8 @@ void as_const(const T&&) = delete;
} // namespace std } // namespace std
#endif // COMPILER_CLANG || COMPILER_GCC #endif // COMPILER_CLANG || COMPILER_GCC
#endif // OS_MAC_OLD
#include "core/ordered_set.h" #include "core/ordered_set.h"
//using uchar = unsigned char; // Qt has uchar //using uchar = unsigned char; // Qt has uchar

View File

@ -1653,7 +1653,8 @@ int StickerPanInner::refreshInlineRows(UserData *bot, const InlineCacheEntry *en
} }
return false; return false;
}; };
if (clearResults()) { auto clearResultsResult = clearResults(); // Clang segfault workaround.
if (clearResultsResult) {
if (resultsDeleted) { if (resultsDeleted) {
clearInlineRows(true); clearInlineRows(true);
deleteUnusedInlineLayouts(); deleteUnusedInlineLayouts();